Commit 6fd2964c authored by Matthias Leich's avatar Matthias Leich

Fix for Bug#58414 Race condition in show_check.test

   Basically take care that disconnects are finished.
parent d09ed4e0
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
# depends on the presence of the log tables (which are CSV-based). # depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc --source include/have_csv.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# #
# Test of some show commands # Test of some show commands
# #
...@@ -53,7 +50,7 @@ optimize table t1; ...@@ -53,7 +50,7 @@ optimize table t1;
optimize table t1; optimize table t1;
drop table t1; drop table t1;
#show variables; # show variables;
--echo -- Here we enable metadata just to check that the collation of the --echo -- Here we enable metadata just to check that the collation of the
--echo -- resultset is non-binary for string type. This should be changed --echo -- resultset is non-binary for string type. This should be changed
...@@ -332,6 +329,7 @@ drop table t1; ...@@ -332,6 +329,7 @@ drop table t1;
--error ER_DBACCESS_DENIED_ERROR --error ER_DBACCESS_DENIED_ERROR
drop database mysqltest; drop database mysqltest;
disconnect con1; disconnect con1;
--source include/wait_until_disconnected.inc
connect (con2,localhost,mysqltest_2,,test); connect (con2,localhost,mysqltest_2,,test);
connection con2; connection con2;
...@@ -344,6 +342,7 @@ drop table mysqltest.t1; ...@@ -344,6 +342,7 @@ drop table mysqltest.t1;
--error ER_DBACCESS_DENIED_ERROR --error ER_DBACCESS_DENIED_ERROR
drop database mysqltest; drop database mysqltest;
disconnect con2; disconnect con2;
--source include/wait_until_disconnected.inc
connect (con3,localhost,mysqltest_3,,test); connect (con3,localhost,mysqltest_3,,test);
connection con3; connection con3;
...@@ -353,6 +352,7 @@ show create database mysqltest; ...@@ -353,6 +352,7 @@ show create database mysqltest;
drop table mysqltest.t1; drop table mysqltest.t1;
drop database mysqltest; drop database mysqltest;
disconnect con3; disconnect con3;
--source include/wait_until_disconnected.inc
connection default; connection default;
set names binary; set names binary;
...@@ -900,10 +900,12 @@ CREATE TABLE t1( ...@@ -900,10 +900,12 @@ CREATE TABLE t1(
--let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql --let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
--source include/count_sessions.inc
--echo --echo
--echo ---> Dumping mysqltest1 to outfile1 --echo ---> Dumping mysqltest1 to outfile1
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1 --exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1
# Take care that the additional session caused by MYSQL_DUMP has disappeared.
--source include/wait_until_count_sessions.inc
# - Clean mysqltest1; # - Clean mysqltest1;
...@@ -917,9 +919,12 @@ DROP DATABASE mysqltest1; ...@@ -917,9 +919,12 @@ DROP DATABASE mysqltest1;
--echo --echo
--echo --echo
--source include/count_sessions.inc
--echo ---> Restoring mysqltest1... --echo ---> Restoring mysqltest1...
--exec $MYSQL test < $outfile1 --exec $MYSQL test < $outfile1
--remove_file $outfile1 --remove_file $outfile1
# Take care that the additional session caused by MYSQL has disappeared.
--source include/wait_until_count_sessions.inc
# - Check definition of the table. # - Check definition of the table.
...@@ -989,14 +994,14 @@ grant select on `mysqltest`.`t1` to mysqltest_4@localhost; ...@@ -989,14 +994,14 @@ grant select on `mysqltest`.`t1` to mysqltest_4@localhost;
connect (con4,localhost,mysqltest_4,,mysqltest); connect (con4,localhost,mysqltest_4,,mysqltest);
connection con4; connection con4;
show create database mysqltest; show create database mysqltest;
disconnect con4;
--source include/wait_until_disconnected.inc
connection default; connection default;
delete from mysql.user where user='mysqltest_4'; delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4'; delete from mysql.db where user='mysqltest_4';
delete from mysql.tables_priv where user='mysqltest_4'; delete from mysql.tables_priv where user='mysqltest_4';
flush privileges; flush privileges;
drop database mysqltest; drop database mysqltest;
connection default;
disconnect con4;
# #
# Ensure that show plugin code is tested # Ensure that show plugin code is tested
...@@ -1192,6 +1197,7 @@ SHOW ENGINE MYISAM STATUS; ...@@ -1192,6 +1197,7 @@ SHOW ENGINE MYISAM STATUS;
--enable_result_log --enable_result_log
disconnect conn1; disconnect conn1;
--source include/wait_until_disconnected.inc
connection default; connection default;
DROP USER test_u@localhost; DROP USER test_u@localhost;
...@@ -1214,8 +1220,9 @@ CONNECTION con1; ...@@ -1214,8 +1220,9 @@ CONNECTION con1;
--error ER_QUERY_INTERRUPTED --error ER_QUERY_INTERRUPTED
SHOW CREATE TABLE non_existent; SHOW CREATE TABLE non_existent;
CONNECTION default;
DISCONNECT con1; DISCONNECT con1;
--source include/wait_until_disconnected.inc
CONNECTION default;
--echo End of 5.1 tests --echo End of 5.1 tests
...@@ -1239,9 +1246,11 @@ connection con1; ...@@ -1239,9 +1246,11 @@ connection con1;
--echo # This statement used to be blocked. --echo # This statement used to be blocked.
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
disconnect con1;
--source include/wait_until_disconnected.inc
--echo # Switching to connection 'default'. --echo # Switching to connection 'default'.
connection default; connection default;
disconnect con1;
UNLOCK TABLES; UNLOCK TABLES;
DROP TABLE t1; DROP TABLE t1;
...@@ -1317,17 +1326,16 @@ connection con1; ...@@ -1317,17 +1326,16 @@ connection con1;
# Should not block. # Should not block.
ALTER TABLE t1 CHARACTER SET = utf8; ALTER TABLE t1 CHARACTER SET = utf8;
disconnect con1;
--source include/wait_until_disconnected.inc
--echo # Connection default --echo # Connection default
connection default; connection default;
COMMIT; COMMIT;
DROP TRIGGER t1_bi; DROP TRIGGER t1_bi;
DROP TABLE t1; DROP TABLE t1;
disconnect con1;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
--echo # --echo #
--echo # Bug#57306 SHOW PROCESSLIST does not display string literals well. --echo # Bug#57306 SHOW PROCESSLIST does not display string literals well.
--echo # --echo #
...@@ -1352,6 +1360,7 @@ SELECT RELEASE_LOCK('t'); ...@@ -1352,6 +1360,7 @@ SELECT RELEASE_LOCK('t');
--connection con1 --connection con1
--reap --reap
--disconnect con1 --disconnect con1
--source include/wait_until_disconnected.inc
--connection default --connection default
SET NAMES latin1; SET NAMES latin1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment