summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/include/concurrent.inc11
-rw-r--r--mysql-test/include/grant_cache.inc19
-rw-r--r--mysql-test/include/handler.inc1
-rw-r--r--mysql-test/include/query_cache.inc3
-rw-r--r--mysql-test/r/concurrent_innodb_safelog.result2
-rw-r--r--mysql-test/r/concurrent_innodb_unsafelog.result2
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result10
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result10
-rw-r--r--mysql-test/r/events_stress.result1
-rw-r--r--mysql-test/r/grant_cache_no_prot.result3
-rw-r--r--mysql-test/r/grant_cache_ps_prot.result3
-rw-r--r--mysql-test/t/archive_bitfield.test6
-rw-r--r--mysql-test/t/client_xml.test9
-rw-r--r--mysql-test/t/csv.test3
-rw-r--r--mysql-test/t/ddl_i18n_koi8r.test21
-rw-r--r--mysql-test/t/ddl_i18n_utf8.test21
-rw-r--r--mysql-test/t/derived.test2
-rw-r--r--mysql-test/t/drop.test5
-rw-r--r--mysql-test/t/events_grant.test7
-rw-r--r--mysql-test/t/events_stress.test6
-rw-r--r--mysql-test/t/events_trans_notembedded.test1
-rw-r--r--mysql-test/t/fix_priv_tables.test5
-rw-r--r--mysql-test/t/flush.test1
-rw-r--r--mysql-test/t/func_compress.test1
-rw-r--r--mysql-test/t/lowercase_fs_off.test6
25 files changed, 122 insertions, 37 deletions
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 2180ec4cc9c..66f8a65a102 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -659,11 +659,16 @@ drop table t1;
connection thread1;
select * from t1;
+--echo ** Cleanup
+connection thread1;
+disconnect thread1;
+--source include/wait_until_disconnected.inc
+--echo ** connection thread2
+connection thread2;
+disconnect thread2;
+--source include/wait_until_disconnected.inc
--echo ** connection default
connection default;
drop table t1;
drop user mysqltest@localhost;
-disconnect thread1;
-disconnect thread2;
-
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
index 501e115f0ee..47eef1cdb67 100644
--- a/mysql-test/include/grant_cache.inc
+++ b/mysql-test/include/grant_cache.inc
@@ -171,15 +171,30 @@ show status like "Qcache_not_cached";
# Cleanup
---echo ----- switch to connection default and close connections -----
-connection default;
+--echo ----- close connections -----
+connection root;
disconnect root;
+--source include/wait_until_disconnected.inc
+connection root2;
disconnect root2;
+--source include/wait_until_disconnected.inc
+connection user1;
disconnect user1;
+--source include/wait_until_disconnected.inc
+connection user2;
disconnect user2;
+--source include/wait_until_disconnected.inc
+connection user3;
disconnect user3;
+--source include/wait_until_disconnected.inc
+connection user4;
disconnect user4;
+--source include/wait_until_disconnected.inc
+connection unkuser;
disconnect unkuser;
+--source include/wait_until_disconnected.inc
+--echo ----- switch to connection default -----
+connection default;
#
# A temporary 4.1 workaround to make this test pass if
diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc
index 96f90aba8e0..6e7f53ba9b2 100644
--- a/mysql-test/include/handler.inc
+++ b/mysql-test/include/handler.inc
@@ -719,6 +719,7 @@ connection con1;
--reap
drop table t1;
disconnect con1;
+--source include/wait_until_disconnected.inc
connection default;
#
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 77ea0021a5d..7ce97b42158 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -177,6 +177,7 @@ show status like "Qcache_hits";
# Final cleanup
eval set GLOBAL query_cache_size=$save_query_cache_size;
+disconnect connection1;
+--source include/wait_until_disconnected.inc
connection default;
drop table t2;
-disconnect connection1;
diff --git a/mysql-test/r/concurrent_innodb_safelog.result b/mysql-test/r/concurrent_innodb_safelog.result
index e6adaac1068..24a84afb9ce 100644
--- a/mysql-test/r/concurrent_innodb_safelog.result
+++ b/mysql-test/r/concurrent_innodb_safelog.result
@@ -785,6 +785,8 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+** Cleanup
+** connection thread2
** connection default
drop table t1;
drop user mysqltest@localhost;
diff --git a/mysql-test/r/concurrent_innodb_unsafelog.result b/mysql-test/r/concurrent_innodb_unsafelog.result
index e9c53d4cfa0..35fc2d89cfe 100644
--- a/mysql-test/r/concurrent_innodb_unsafelog.result
+++ b/mysql-test/r/concurrent_innodb_unsafelog.result
@@ -781,6 +781,8 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+** Cleanup
+** connection thread2
** connection default
drop table t1;
drop user mysqltest@localhost;
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result
index af3a0899181..fe24c17a1c5 100644
--- a/mysql-test/r/ddl_i18n_koi8r.result
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -2829,7 +2829,11 @@ t2 CREATE TABLE `t2` (
`col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+---> connection: con2
+
+---> connection: con3
+
---> connection: default
-use test|
-DROP DATABASE mysqltest1|
-DROP DATABASE mysqltest2|
+USE test;
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
index 10c2afcadc1..cf4272bf90c 100644
--- a/mysql-test/r/ddl_i18n_utf8.result
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -2829,7 +2829,11 @@ t2 CREATE TABLE `t2` (
`col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
+---> connection: con2
+
+---> connection: con3
+
---> connection: default
-use test|
-DROP DATABASE mysqltest1|
-DROP DATABASE mysqltest2|
+USE test;
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
diff --git a/mysql-test/r/events_stress.result b/mysql-test/r/events_stress.result
index 17eb32b36b7..9b9f3caaff6 100644
--- a/mysql-test/r/events_stress.result
+++ b/mysql-test/r/events_stress.result
@@ -63,3 +63,4 @@ DROP TABLE fill_it1;
DROP TABLE fill_it2;
DROP TABLE fill_it3;
DROP DATABASE events_test;
+SET GLOBAL event_scheduler=off;
diff --git a/mysql-test/r/grant_cache_no_prot.result b/mysql-test/r/grant_cache_no_prot.result
index cb9acaf540d..32bb9cce90e 100644
--- a/mysql-test/r/grant_cache_no_prot.result
+++ b/mysql-test/r/grant_cache_no_prot.result
@@ -206,7 +206,8 @@ Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 8
------ switch to connection default and close connections -----
+----- close connections -----
+----- switch to connection default -----
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result
index cf1450f3b75..281468ee2e1 100644
--- a/mysql-test/r/grant_cache_ps_prot.result
+++ b/mysql-test/r/grant_cache_ps_prot.result
@@ -206,7 +206,8 @@ Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 5
------ switch to connection default and close connections -----
+----- close connections -----
+----- switch to connection default -----
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/t/archive_bitfield.test b/mysql-test/t/archive_bitfield.test
index 1e4692270b5..2e90ce39708 100644
--- a/mysql-test/t/archive_bitfield.test
+++ b/mysql-test/t/archive_bitfield.test
@@ -94,5 +94,11 @@ INSERT INTO `t1` VALUES
(NULL,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
(NULL,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
(NULL,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
+# Determine the number of open sessions
+--source include/count_sessions.inc
--exec $MYSQL_DUMP --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
drop table t1;
+# Wait till the number of open sessions is <= the number before the run with $MYSQL_DUMP
+# = The session caused by mysqldump has finished its disconnect
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/t/client_xml.test b/mysql-test/t/client_xml.test
index 739b56f5ab1..0847e2b366b 100644
--- a/mysql-test/t/client_xml.test
+++ b/mysql-test/t/client_xml.test
@@ -18,6 +18,10 @@ create table t1 (
`a>b` text
);
insert into t1 values (1, 2, 'a&b a<b a>b');
+
+# Determine the number of open sessions
+--source include/count_sessions.inc
+
--exec $MYSQL --xml test -e "select * from t1"
--exec $MYSQL_DUMP --xml --skip-create test
@@ -33,3 +37,8 @@ drop table t1;
# Restore global concurrent_insert value
set @@global.concurrent_insert= @old_concurrent_insert;
+
+# Wait till the number of open sessions is <= the number before the runs with
+# $MYSQL and $MYSQL_DUMP
+# = The session caused by mysql and mysqldump have finished their disconnect
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index abc161d014c..cdf274190dd 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1800,10 +1800,11 @@ connect (con1,localhost,root,,);
# EE_FILENOTFOUND 29
--error 29
select * from t1;
+--disconnect con1
+--source include/wait_until_disconnected.inc
connection default;
unlock tables;
drop table t1;
---disconnect con1
#
# Bug#41441 repair csv table crashes debug server
diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test
index 2d94a899aad..fecef2f95d5 100644
--- a/mysql-test/t/ddl_i18n_koi8r.test
+++ b/mysql-test/t/ddl_i18n_koi8r.test
@@ -1128,15 +1128,22 @@ SHOW CREATE TABLE mysqltest2.t2|
#
# Cleanup.
#
+delimiter ;|
---connection default
+--connection con2
--echo
---echo ---> connection: default
-
+--echo ---> connection: con2
--disconnect con2
+--source include/wait_until_disconnected.inc
+--connection con3
+--echo
+--echo ---> connection: con3
--disconnect con3
+--source include/wait_until_disconnected.inc
+--connection default
+--echo
+--echo ---> connection: default
+USE test;
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
-use test|
-
-DROP DATABASE mysqltest1|
-DROP DATABASE mysqltest2|
diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test
index 1d5415d9373..8788d0604f2 100644
--- a/mysql-test/t/ddl_i18n_utf8.test
+++ b/mysql-test/t/ddl_i18n_utf8.test
@@ -1128,15 +1128,22 @@ SHOW CREATE TABLE mysqltest2.t2|
#
# Cleanup.
#
+delimiter ;|
---connection default
+--connection con2
--echo
---echo ---> connection: default
-
+--echo ---> connection: con2
--disconnect con2
+--source include/wait_until_disconnected.inc
+--connection con3
+--echo
+--echo ---> connection: con3
--disconnect con3
+--source include/wait_until_disconnected.inc
+--connection default
+--echo
+--echo ---> connection: default
+USE test;
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
-use test|
-
-DROP DATABASE mysqltest1|
-DROP DATABASE mysqltest2|
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 4e79fac584f..bf5cd4aa8d8 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -273,7 +273,9 @@ select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID);
select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
drop table t1, t2;
+connection con1;
disconnect con1;
+--source include/wait_until_disconnected.inc
connection default;
drop user mysqltest_1;
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index 91345886e93..bb4dd3e11f9 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -117,8 +117,11 @@ connection addconroot1;
--reap
connection addconroot2;
--reap
-disconnect addconroot1;
disconnect addconroot2;
+--source include/wait_until_disconnected.inc
+connection addconroot1;
+disconnect addconroot1;
+--source include/wait_until_disconnected.inc
connection default;
--echo End of 5.0 tests
diff --git a/mysql-test/t/events_grant.test b/mysql-test/t/events_grant.test
index cff2475c5aa..8db4333cc03 100644
--- a/mysql-test/t/events_grant.test
+++ b/mysql-test/t/events_grant.test
@@ -97,7 +97,9 @@ DROP EVENT one_event;
connection default;
--echo "One event should not be there"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
+connection ev_con1;
disconnect ev_con1;
+--source include/wait_until_disconnected.inc
connection default;
DROP USER ev_test@localhost;
DROP DATABASE events_test2;
@@ -106,9 +108,6 @@ DROP DATABASE events_test2;
# End of tests
#
-let $wait_condition=
- select count(*) = 0 from information_schema.processlist
- where db='events_test' and command = 'Connect' and user=current_user();
---source include/wait_condition.inc
+--source include/check_events_off.inc
DROP DATABASE events_test;
diff --git a/mysql-test/t/events_stress.test b/mysql-test/t/events_stress.test
index 22959898b43..e51fa734256 100644
--- a/mysql-test/t/events_stress.test
+++ b/mysql-test/t/events_stress.test
@@ -109,7 +109,7 @@ connection conn3;
--send
DROP DATABASE events_conn3_db;
connection default;
---send
+# --send
DROP DATABASE events_conn1_test2;
DROP DATABASE events_conn1_test3;
SET GLOBAL event_scheduler=off;
@@ -135,3 +135,7 @@ DROP USER event_user3@localhost;
#
DROP DATABASE events_test;
+
+# Cleanup
+SET GLOBAL event_scheduler=off;
+--source include/check_events_off.inc
diff --git a/mysql-test/t/events_trans_notembedded.test b/mysql-test/t/events_trans_notembedded.test
index 3c151dd18b1..0353d183386 100644
--- a/mysql-test/t/events_trans_notembedded.test
+++ b/mysql-test/t/events_trans_notembedded.test
@@ -50,6 +50,7 @@ delete from t1;
commit work;
# Cleanup
disconnect conn1;
+--source include/wait_until_disconnected.inc
connection default;
drop user mysqltest_user1@localhost;
drop database mysqltest_db2;
diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test
index c7cd500f8d2..eeda9bc8d15 100644
--- a/mysql-test/t/fix_priv_tables.test
+++ b/mysql-test/t/fix_priv_tables.test
@@ -51,8 +51,13 @@ echo;
-- disable_query_log
# Run the mysql_fix_privilege_tables.sql using "mysql --force"
+# Determine the number of open sessions
+--source include/count_sessions.inc
--exec $MYSQL --force mysql < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/tmp/fix_priv_tables.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/fix_priv_tables.log
+# Wait till the number of open sessions is <= the number before the run with $MYSQL
+# = The session caused by mysql has finished its disconnect
+--source include/wait_until_count_sessions.inc
-- enable_query_log
-- enable_result_log
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index c832cb79158..f27d4cf2fad 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -171,6 +171,7 @@ set session low_priority_updates=default;
connect (con1,localhost,root,,);
send select benchmark(200, (select sin(1))) > 1000;
disconnect con1;
+--source include/wait_until_disconnected.inc
connection default;
--echo End of 5.0 tests
diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test
index 0a3a3823fee..4c5121da345 100644
--- a/mysql-test/t/func_compress.test
+++ b/mysql-test/t/func_compress.test
@@ -50,6 +50,7 @@ set @@global.max_allowed_packet=1048576*100;
--connect (newconn, localhost, root,,)
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;
disconnect newconn;
+--source include/wait_until_disconnected.inc
connection default;
set @@global.max_allowed_packet=default;
diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test
index 414027cb485..878564c32ab 100644
--- a/mysql-test/t/lowercase_fs_off.test
+++ b/mysql-test/t/lowercase_fs_off.test
@@ -14,16 +14,18 @@ flush privileges;
connect (sample,localhost,sample,password,d1);
connection sample;
select database();
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create database d2;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create database D1;
disconnect sample;
+--source include/wait_until_disconnected.inc
connection master;
drop user 'sample'@'localhost';
drop database if exists d1;
disconnect master;
+--source include/wait_until_disconnected.inc
connection default;
# End of 4.1 tests