summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-08-31 08:49:49 -0600
committerunknown <malff/marcsql@weblab.(none)>2007-08-31 08:49:49 -0600
commit3d15ac95d605b44f4b06c4c7798b53adcbac6ed1 (patch)
tree8f1d1a4a733277c131e0edd75f8be61fa0f84f4c /mysql-test
parent0458c3cfc8dbe6a0c3914047d9a21e31f87bb28b (diff)
downloadmariadb-git-3d15ac95d605b44f4b06c4c7798b53adcbac6ed1.tar.gz
Test cleanup for events.test
mysql-test/r/events.result: Fixed all the select on information_schema.processlist to be more reliable. mysql-test/t/events.test: Fixed all the select on information_schema.processlist to be more reliable.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/events.result26
-rw-r--r--mysql-test/t/events.test41
2 files changed, 49 insertions, 18 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index be67e2acc7b..d1ee6d1c5a1 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -454,8 +454,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
select definer, name, db from mysql.event;
definer name db
root@localhost закачка events_test
-"Should be only 1 process"
-select /*1*/ 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;
+"Should be only 0 process"
+select /*1*/ user, host, db, command, state, info
+from information_schema.processlist
+where (user='event_scheduler')
+order by info;
user host db command state info
select release_lock("test_lock1");
release_lock("test_lock1")
@@ -472,14 +475,15 @@ get_lock("test_lock2", 20)
1
"Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
-"Let some time pass to the event starts"
"Should have only 2 processes: the scheduler and the locked event"
-select /*2*/ 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 /*2*/ user, host, db, command, state, info
+from information_schema.processlist
+where (info like "select get_lock%" OR user='event_scheduler')
+order by info;
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2", 20)
"Release the mutex, the event worker should finish."
-"Release the mutex, the event worker should finish."
select release_lock("test_lock2");
release_lock("test_lock2")
1
@@ -489,14 +493,20 @@ select get_lock("test_lock2_1", 20);
get_lock("test_lock2_1", 20)
1
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
-"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;
+"Should have only 2 processes: the scheduler and the locked event"
+select /*3*/ user, host, db, command, state, info
+from information_schema.processlist
+where (info like "select get_lock%" OR user='event_scheduler')
+order by info;
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
set global event_scheduler=off;
"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 /*4*/ user, host, db, command, state, info
+from information_schema.processlist
+where (info like "select get_lock%" OR user='event_scheduler')
+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");
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index cbb36cbd2be..365318e1db9 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -432,8 +432,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
--echo "Should return 1 row"
select definer, name, db from mysql.event;
---echo "Should be only 1 process"
-select /*1*/ 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;
+--echo "Should be only 0 process"
+select /*1*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (user='event_scheduler')
+ order by info;
select release_lock("test_lock1");
drop event закачка;
--echo "Should have 0 events"
@@ -447,10 +450,16 @@ set global event_scheduler=on;
select get_lock("test_lock2", 20);
--echo "Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
---echo "Let some time pass to the event starts"
---sleep 1
+
--echo "Should have only 2 processes: the scheduler and the locked event"
-select /*2*/ 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;--echo "Release the mutex, the event worker should finish."
+let $wait_condition= select count(*) = 2 from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler');
+--source include/wait_condition.inc
+
+select /*2*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler')
+ order by info;
--echo "Release the mutex, the event worker should finish."
select release_lock("test_lock2");
drop event закачка;
@@ -466,16 +475,28 @@ 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);
-let $wait_condition= select count(*) = 3 from information_schema.processlist;
+
+--echo "Should have only 2 processes: the scheduler and the locked event"
+let $wait_condition= select count(*) = 2 from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler');
--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;
+
+select /*3*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler')
+ order by info;
+
set global event_scheduler=off;
+
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;
+ where (info like "select get_lock%" OR user='event_scheduler');
--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 /*4*/ user, host, db, command, state, info
+ from information_schema.processlist
+ where (info like "select get_lock%" OR user='event_scheduler')
+ order by info;
select release_lock("test_lock2_1");
drop event закачка21;
let $wait_condition=