diff options
author | Matthias Leich <Matthias.Leich@sun.com> | 2009-03-06 15:56:17 +0100 |
---|---|---|
committer | Matthias Leich <Matthias.Leich@sun.com> | 2009-03-06 15:56:17 +0100 |
commit | 2417d31045cde81881a9dd7991263210687d5fc8 (patch) | |
tree | 88da5851e80389eb99993e7f017a4a90b48f7a00 /mysql-test/t/flush_read_lock_kill.test | |
parent | 16c0631f0b785e82aef63429b5a4e7179b8aa52e (diff) | |
parent | 0183d4d8422ba29a632eebb1e856391f2b9a289f (diff) | |
download | mariadb-git-2417d31045cde81881a9dd7991263210687d5fc8.tar.gz |
Merge 5.0 -> 5.1 of fix for Bug#42003 and Bug#43114
Diffstat (limited to 'mysql-test/t/flush_read_lock_kill.test')
-rw-r--r-- | mysql-test/t/flush_read_lock_kill.test | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/mysql-test/t/flush_read_lock_kill.test b/mysql-test/t/flush_read_lock_kill.test index c03f3be2534..aeb09d52460 100644 --- a/mysql-test/t/flush_read_lock_kill.test +++ b/mysql-test/t/flush_read_lock_kill.test @@ -8,24 +8,27 @@ # won't test anything interesting). # This also won't work with the embedded server test --- source include/not_embedded.inc +--source include/not_embedded.inc --- source include/have_debug.inc +--source include/have_debug.inc + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc # Disable concurrent inserts to avoid test failures when reading the # connection id which was inserted into a table by another thread. -set @old_concurrent_insert= @@global.concurrent_insert; -set @@global.concurrent_insert= 0; +SET @old_concurrent_insert= @@global.concurrent_insert; +SET @@global.concurrent_insert= 0; connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con1; --disable_warnings -drop table if exists t1; +DROP TABLE IF EXISTS t1; --enable_warnings -create table t1 (kill_id int); -insert into t1 values(connection_id()); +CREATE TABLE t1 (kill_id INT); +INSERT INTO t1 VALUES(connection_id()); # Thanks to the parameter we passed to --debug, this FLUSH will # block on a debug build running with our --debug=make_global... It @@ -33,11 +36,11 @@ insert into t1 values(connection_id()); # --debug) it will succeed immediately connection con1; -send flush tables with read lock; +send FLUSH TABLES WITH READ LOCK; # kill con1 connection con2; -select ((@id := kill_id) - kill_id) from t1; +SELECT ((@id := kill_id) - kill_id) FROM t1; # Wait for the debug sync point, test won't run on non-debug # builds anyway. @@ -47,7 +50,7 @@ let $wait_condition= and info = "flush tables with read lock"; --source include/wait_condition.inc -kill connection @id; +KILL CONNECTION @id; connection con1; # On debug builds it will be error 1053 (killed); on non-debug, or @@ -58,8 +61,14 @@ connection con1; reap; connection con2; -drop table t1; +DROP TABLE t1; + connection default; +disconnect con2; # Restore global concurrent_insert value -set @@global.concurrent_insert= @old_concurrent_insert; +SET @@global.concurrent_insert= @old_concurrent_insert; + +# Wait till all disconnects are completed +--source include/wait_until_count_sessions.inc + |