MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:February 28 2008 12:35pm
Subject:bk commit into 5.1 tree (anozdrin:1.2549) BUG#34852
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of anozdrin.  When anozdrin does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-28 15:35:25+03:00, anozdrin@quad. +2 -0
  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@stripped, 2008-02-28 15:35:24+03:00, anozdrin@quad. +33 -42
    Fix result file.

  mysql-test/t/show_check.test@stripped, 2008-02-28 15:35:24+03:00, anozdrin@quad. +55 -17
    Make test case for Bug#12183 stable.

diff -Nrup a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
--- a/mysql-test/r/show_check.result	2008-02-22 13:30:29 +03:00
+++ b/mysql-test/r/show_check.result	2008-02-28 15:35:24 +03:00
@@ -662,53 +662,44 @@ t1	NULL	NULL	NULL	NULL	#	#	#	#	NULL	NULL
 show create table t1;
 ERROR HY000: Incorrect information in file: './test/t1.frm'
 drop table if exists t1;
-CREATE TABLE txt1(a int);
-CREATE TABLE tyt2(a int);
-CREATE TABLE urkunde(a int);
+
+# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
+
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+use mysqltest1;
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+
 FLUSH TABLES;
-SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone_name, txt1, tyt2, urkunde LIMIT 0;
+
+SELECT 1 FROM t1;
 1
-SHOW OPEN TABLES;
-Database	Table	In_use	Name_locked
-mysql	db	0	0
-test	urkunde	0	0
-mysql	time_zone	0	0
-mysql	general_log	0	0
-test	txt1	0	0
-mysql	proc	0	0
-test	tyt2	0	0
-mysql	user	0	0
-mysql	time_zone_name	0	0
-SHOW OPEN TABLES FROM mysql;
-Database	Table	In_use	Name_locked
-mysql	db	0	0
-mysql	time_zone	0	0
-mysql	general_log	0	0
-mysql	proc	0	0
-mysql	user	0	0
-mysql	time_zone_name	0	0
-SHOW OPEN TABLES FROM mysql LIKE 'u%';
-Database	Table	In_use	Name_locked
-mysql	user	0	0
-SHOW OPEN TABLES LIKE 't%';
+SELECT 1 FROM t2;
+1
+
+SHOW OPEN TABLES FROM mysqltest1;
 Database	Table	In_use	Name_locked
-mysql	time_zone	0	0
-test	txt1	0	0
-test	tyt2	0	0
-mysql	time_zone_name	0	0
-SHOW OPEN TABLES LIKE '%o%';
+mysqltest1	t1	0	0
+mysqltest1	t2	0	0
+
+SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
+Database	Table	In_use	Name_locked
+
+SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
+Database	Table	In_use	Name_locked
+mysqltest1	t1	0	0
+
+SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
 Database	Table	In_use	Name_locked
-mysql	time_zone	0	0
-mysql	general_log	0	0
-mysql	proc	0	0
-mysql	time_zone_name	0	0
+mysqltest1	t1	0	0
+
 FLUSH TABLES;
-SHOW OPEN TABLES;
-Database	Table	In_use	Name_locked
-mysql	general_log	0	0
-DROP TABLE txt1;
-DROP TABLE tyt2;
-DROP TABLE urkunde;
+
+DROP DATABASE mysqltest1;
+use test;
+
 SHOW TABLES FROM non_existing_database;
 ERROR 42000: Unknown database 'non_existing_database'
 End of 4.1 tests
diff -Nrup a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
--- a/mysql-test/t/show_check.test	2008-02-06 16:20:12 +03:00
+++ b/mysql-test/t/show_check.test	2008-02-28 15:35:24 +03:00
@@ -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)
 #
Thread
bk commit into 5.1 tree (anozdrin:1.2549) BUG#34852Alexander Nozdrin28 Feb