From d58c9e089e232484ab8ab92a16b6660e8b8ce269 Mon Sep 17 00:00:00 2001 From: "davi@mysql.com/endora.local" <> Date: Wed, 27 Feb 2008 18:08:29 -0300 Subject: [PATCH] Fix for team tree failure. Synchronously wait for the query state to reach the desired value. --- mysql-test/r/flush_read_lock_kill.result | 1 + mysql-test/t/flush_read_lock_kill.test | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/flush_read_lock_kill.result b/mysql-test/r/flush_read_lock_kill.result index 6703b6bd533..f69656806da 100644 --- a/mysql-test/r/flush_read_lock_kill.result +++ b/mysql-test/r/flush_read_lock_kill.result @@ -1,3 +1,4 @@ +set @@global.concurrent_insert= 0; drop table if exists t1; create table t1 (kill_id int); insert into t1 values(connection_id()); diff --git a/mysql-test/t/flush_read_lock_kill.test b/mysql-test/t/flush_read_lock_kill.test index 19a47b2893a..c3926d09205 100644 --- a/mysql-test/t/flush_read_lock_kill.test +++ b/mysql-test/t/flush_read_lock_kill.test @@ -12,6 +12,10 @@ -- source include/have_debug.inc +# Disable concurrent inserts to avoid test failures when reading the +# connection id which was inserted into a table by another thread. +set @@global.concurrent_insert= 0; + connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con1; @@ -34,7 +38,14 @@ send flush tables with read lock; connection con2; select ((@id := kill_id) - kill_id) from t1; ---sleep 2 # leave time for FLUSH to block +# Wait for the debug sync point, test won't run on non-debug +# builds anyway. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for all running commits to finish" + and info = "flush tables with read lock"; +--source include/wait_condition.inc + kill connection @id; connection con1;