@@ -334,7 +334,7 @@ select definer, name, db from mysql.event;
...
@@ -334,7 +334,7 @@ select definer, name, db from mysql.event;
definer name db
definer name db
root@localhost закачка events_test
root@localhost закачка events_test
"Should be only 1 process"
"Should be only 1 process"
select /*1*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
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;
user host db command state info
user host db command state info
select release_lock("test_lock1");
select release_lock("test_lock1");
release_lock("test_lock1")
release_lock("test_lock1")
...
@@ -353,7 +353,7 @@ get_lock("test_lock2", 20)
...
@@ -353,7 +353,7 @@ get_lock("test_lock2", 20)
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
"Let some time pass to the event starts"
"Let some time pass to the event starts"
"Should have only 2 processes: the scheduler and the locked event"
"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' 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 (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
user host db command state info
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2", 20)
root localhost events_test Connect User lock select get_lock("test_lock2", 20)
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
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"
"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' 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 (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
user host db command state info
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
set global event_scheduler=off;
set global event_scheduler=off;
"Should have only our process now:"
"Should have only our process now:"
select /*4*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' 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 (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
user host db command state info
user host db command state info
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
"Now if everything is fine the event has compiled and is locked
"Now if everything is fine the event has compiled and is locked
select /*1*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*1*/ user, host, db, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
select /*2*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*2*/ user, host, db, 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, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*3*/ user, host, db, 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, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*4*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
select /*5*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*5*/ user, host, db, 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 info
user host db info
event_scheduler localhost NULL NULL
event_scheduler localhost NULL NULL
select * from events_smode_test order by ev_name, a;
select * from events_smode_test order by ev_name, a;
@@ -312,7 +312,7 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
...
@@ -312,7 +312,7 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
--echo"Let some time pass to the event starts"
--echo"Let some time pass to the event starts"
--sleep1
--sleep1
--echo"Should have only 2 processes: the scheduler and the locked event"
--echo"Should have only 2 processes: the scheduler and the locked event"
select/*2*/user,host,db,command,state,infofrominformation_schema.processlistwherecommand!='Daemon'and(infoisnullorinfonotlike'%processlist%')orderbyinfo;--echo"Release the mutex, the event worker should finish."
select/*2*/user,host,db,command,state,infofrominformation_schema.processlistwhere(command!='Daemon'||user='event_scheduler')and(infoisnullorinfonotlike'%processlist%')orderbyinfo;--echo"Release the mutex, the event worker should finish."
--echo"Release the mutex, the event worker should finish."
--echo"Release the mutex, the event worker should finish."
--echo"Now if everything is fine the event has compiled and is locked
--echo"Now if everything is fine the event has compiled and is locked
select /*1*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*1*/ user, host, db, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
select release_lock('test_bug16407');
select release_lock('test_bug16407');
set global event_scheduler= off;
set global event_scheduler= off;
...
@@ -128,10 +128,10 @@ end|
...
@@ -128,10 +128,10 @@ end|
delimiter ;|
delimiter ;|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
--sleep 1
--sleep 1
select /*2*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*2*/ user, host, db, 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('ee_16407_2');
select release_lock('ee_16407_2');
--sleep 1.2
--sleep 1.2
select /*3*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*3*/ user, host, db, 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;
set global event_scheduler= off;
select * from events_smode_test order by ev_name, a;
select * from events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
--echo "OK, last check before we drop them"
...
@@ -167,11 +167,11 @@ end|
...
@@ -167,11 +167,11 @@ end|
delimiter ;|
delimiter ;|
--sleep 1
--sleep 1
--echo "Should have 2 locked processes"
--echo "Should have 2 locked processes"
select /*4*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*4*/ user, host, db, 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('ee_16407_5');
select release_lock('ee_16407_5');
--sleep 1.3
--sleep 1.3
--echo "Should have 0 processes locked"
--echo "Should have 0 processes locked"
select /*5*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select /*5*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info;
select * from events_smode_test order by ev_name, a;
select * from events_smode_test order by ev_name, a;
--echo "And here we check one more time before we drop the events"
--echo "And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;