summaryrefslogtreecommitdiff
path: root/mysql-test/t/show_check.test
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@quad.>2008-02-28 15:35:25 +0300
committerunknown <anozdrin/alik@quad.>2008-02-28 15:35:25 +0300
commitce7b8e1248d7fe32824ebdc1fa0146c376e743dd (patch)
tree44bb2244cb52250a0a60daf88f0014aacd0144e6 /mysql-test/t/show_check.test
parentba3112b539609ddd62b45935f3b0cd09530cc88b (diff)
downloadmariadb-git-ce7b8e1248d7fe32824ebdc1fa0146c376e743dd.tar.gz
Fix for Bug#34852: SHOW OPEN TABLES output is not repeatable
(show_check.test fails sporadically). Fix test case for Bug#12183 to make it stable. mysql-test/r/show_check.result: Fix result file. mysql-test/t/show_check.test: Make test case for Bug#12183 stable.
Diffstat (limited to 'mysql-test/t/show_check.test')
-rw-r--r--mysql-test/t/show_check.test70
1 files changed, 54 insertions, 16 deletions
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 613e9acc4c4..9d32b50fd74 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -435,28 +435,66 @@ drop table if exists t1;
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
# First we close all open tables with FLUSH tables and then we open some.
#
-CREATE TABLE txt1(a int);
-CREATE TABLE tyt2(a int);
-CREATE TABLE urkunde(a int);
-# make the output deterministic:
-# the order used in SHOW OPEN TABLES
-# is too much implementation dependent
+--echo
+--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
+--echo
+
+# NOTE: SHOW OPEN TABLES does not sort result list by database or table names.
+# Tables are listed in the order they were opened. We can not use the system
+# database (mysql) for the test here, because we have no control over the order
+# of opening tables in it. Consequently, we can not use 'SHOW OPEN TABLES'.
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
+
+CREATE DATABASE mysqltest1;
+use mysqltest1;
+
+--echo
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+
+--echo
+
--disable_ps_protocol
FLUSH TABLES;
-SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone_name, txt1, tyt2, urkunde LIMIT 0;
-SHOW OPEN TABLES;
-SHOW OPEN TABLES FROM mysql;
-SHOW OPEN TABLES FROM mysql LIKE 'u%';
-SHOW OPEN TABLES LIKE 't%';
-SHOW OPEN TABLES LIKE '%o%';
+
+--echo
+
+SELECT 1 FROM t1;
+SELECT 1 FROM t2;
+
+--echo
+
+SHOW OPEN TABLES FROM mysqltest1;
+
+--echo
+
+SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
+
+--echo
+
+SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
+
+--echo
+
+SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
+
+--echo
+
FLUSH TABLES;
-SHOW OPEN TABLES;
--enable_ps_protocol
-DROP TABLE txt1;
-DROP TABLE tyt2;
-DROP TABLE urkunde;
+--echo
+
+DROP DATABASE mysqltest1;
+use test;
+
+--echo
+
#
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
#