From 55d65833cabf91bd62d8065840a2eadc1c784ded Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Aug 2007 15:37:55 +0200 Subject: Bug#28285 Test "events_bugs" has instable results of "select /*1*/ ... from processlist" Test case contains possible race conditions. This patch fixes these race conditions and also adjust the test to execute according to its documentation. mysql-test/r/events.result: Modified test case to fit test documentation mysql-test/t/events.test: Modified test case to fit test documentation --- mysql-test/r/events.result | 3 +++ mysql-test/t/events.test | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 579f5907882..be67e2acc7b 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -499,6 +499,9 @@ set global event_scheduler=off; select /*4*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; user host db command state info root localhost events_test Connect User lock select get_lock("test_lock2_1", 20) +select release_lock("test_lock2_1"); +release_lock("test_lock2_1") +1 drop event закачка21; create table t_16 (s1 int); create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5; diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index d7232705b81..cbb36cbd2be 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -466,13 +466,17 @@ drop event закачка; set global event_scheduler=1; select get_lock("test_lock2_1", 20); create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20); ---sleep 1 +let $wait_condition= select count(*) = 3 from information_schema.processlist; +--source include/wait_condition.inc --echo "Should have only 3 processes: the scheduler, our conn and the locked event" select /*3*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; set global event_scheduler=off; ---sleep 0.8 +let $wait_condition= select count(*) =1 from information_schema.processlist + where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; +--source include/wait_condition.inc --echo "Should have only our process now:" select /*4*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; +select release_lock("test_lock2_1"); drop event закачка21; let $wait_condition= select count(*) = 0 from information_schema.processlist -- cgit v1.2.1