@@ -454,8 +454,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
...
@@ -454,8 +454,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
select definer, name, db from mysql.event;
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 0 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;
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
user host db command state info
select release_lock("test_lock1");
select release_lock("test_lock1");
release_lock("test_lock1")
release_lock("test_lock1")
...
@@ -472,14 +475,15 @@ get_lock("test_lock2", 20)
...
@@ -472,14 +475,15 @@ get_lock("test_lock2", 20)
1
1
"Create an event which tries to acquire a mutex. The event locks on the mutex"
"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);
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"
"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
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)
"Release the mutex, the event worker should finish."
"Release the mutex, the event worker should finish."
"Release the mutex, the event worker should finish."
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 2 processes: the scheduler 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;
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' || 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
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)
--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.processlistwhere(command!='Daemon'||user='event_scheduler')and(infoisnullorinfonotlike'%processlist%')orderbyinfo;--echo"Release the mutex, the event worker should finish."