ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default '';
ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default '';
Warnings:
Warning 1265 Data truncated for column 'db' at row 1
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log.
ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log.
ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default '';
ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default '';
...
@@ -389,10 +387,9 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
...
@@ -389,10 +387,9 @@ 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 0 processes"
show processlist;
select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
select release_lock("test_lock1");
select release_lock("test_lock1");
release_lock("test_lock1")
release_lock("test_lock1")
1
1
...
@@ -409,12 +406,11 @@ get_lock("test_lock2", 20)
...
@@ -409,12 +406,11 @@ get_lock("test_lock2", 20)
"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"
"Let some time pass to the event starts"
"Should have only 3 processes: the scheduler, our conn and the locked event"
"Should have only 2 processes: the scheduler and the locked event"
show processlist;
select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
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 see 2 processes, one locked on get_lock("
"Should see 1 process, locked on get_lock("
"Shutting down the scheduler, it should wait for the running event"
"Shutting down the scheduler, it should wait for the running event"
set global event_scheduler=0;
set global event_scheduler=0;
"Should have only 3 processes: the scheduler, our conn and the locked event"
"Should have only 2 processes: the scheduler and the locked event"
show processlist;
select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
"Release the lock so the child process should finish. Hence the scheduler also"
"Release the lock so the child process should finish. Hence the scheduler also"
select release_lock("test_lock2_1");
select release_lock("test_lock2_1");
release_lock("test_lock2_1")
release_lock("test_lock2_1")
1
1
"Should have only our process now:"
"Should see 0 processes now:"
show processlist;
select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
drop event закачка21;
drop event закачка21;
create table t_16 (s1 int);
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;
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;
"Now if everything is fine the event has compiled and is locked
"Now if everything is fine the event has compiled and is locked
show processlist;
select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
Id User Host db Command Time State Info
user host db command state info
# root localhost events_test Query # NULL show processlist
select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
# root localhost events_test Query # NULL show processlist
root localhost events_test Connect User lock select get_lock('ee_16407_5', 60) /*ee_16407_6*/
select release_lock('ee_16407_5');
select release_lock('ee_16407_5');
release_lock('ee_16407_5')
release_lock('ee_16407_5')
1
1
show processlist;
"Should have 0 processes locked"
Id User Host db Command Time State Info
select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
# root localhost events_test Query # NULL show processlist
--echo"Should see 2 processes, one locked on get_lock("
--echo"Should see 1 process, locked on get_lock("
#--replace_column 1 # 6 #
#select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
#show processlist;
--echo"Shutting down the scheduler, it should wait for the running event"
--echo"Shutting down the scheduler, it should wait for the running event"
setglobalevent_scheduler=0;
setglobalevent_scheduler=0;
--sleep1
--sleep1
--echo"Should have only 3 processes: the scheduler, our conn and the locked event"
--echo"Should have only 2 processes: the scheduler and the locked event"
##create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20);
##create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20);
##select sleep(2);
##select sleep(2);
##show processlist;
##select /*7*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
##drop event закачка;
##drop event закачка;
##select release_lock("test_lock3");
##select release_lock("test_lock3");
...
@@ -451,15 +446,13 @@ drop event e1;
...
@@ -451,15 +446,13 @@ drop event e1;
##select get_lock("test_lock4", 20);
##select get_lock("test_lock4", 20);
##create event закачка4 on schedule every 1 second do select get_lock("test_lock4", 20);
##create event закачка4 on schedule every 1 second do select get_lock("test_lock4", 20);
##select sleep(3);
##select sleep(3);
##--replace_column 1 # 6 #
##select /*8*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
##show processlist;
##drop event закачка4;
##drop event закачка4;
##select release_lock("test_lock4");
##select release_lock("test_lock4");
##set global event_scheduler=0;
##set global event_scheduler=0;
##select sleep(2);
##select sleep(2);
##--replace_column 1 # 6 #
##select /*9*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
--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
--replace_column 1 # 6 #
select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
show processlist;
select release_lock('test_bug16407');
select release_lock('test_bug16407');
set global event_scheduler= 0;
set global event_scheduler= 0;
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;
create event ee_16407_2 on schedule every 60 second do
create event ee_16407_2 on schedule every 60 second do
begin
begin
select get_lock('ee_16407_2', 60);
select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
end|
--error ER_TRUNCATED_WRONG_VALUE
--error ER_TRUNCATED_WRONG_VALUE
...
@@ -103,7 +102,7 @@ insert into events_smode_test values ('test','1980-19-02')|
...
@@ -103,7 +102,7 @@ insert into events_smode_test values ('test','1980-19-02')|
--echo "This is ok"
--echo "This is ok"
create event ee_16407_3 on schedule every 60 second do
create event ee_16407_3 on schedule every 60 second do
begin
begin
select get_lock('ee_16407_2', 60);
select get_lock('ee_16407_2', 60) /*ee_16407_3*/;
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29');
end|
end|
...
@@ -111,7 +110,7 @@ set sql_mode=""|
...
@@ -111,7 +110,7 @@ set sql_mode=""|
--echo "This will insert rows but they will be truncated"
--echo "This will insert rows but they will be truncated"
create event ee_16407_4 on schedule every 60 second do
create event ee_16407_4 on schedule every 60 second do
begin
begin
select get_lock('ee_16407_2', 60);
select get_lock('ee_16407_2', 60) /*ee_16407_4*/;
insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
end|
end|
delimiter ;|
delimiter ;|
...
@@ -120,12 +119,10 @@ set sql_mode="ansi";
...
@@ -120,12 +119,10 @@ set sql_mode="ansi";
select get_lock('ee_16407_2', 60);
select get_lock('ee_16407_2', 60);
set global event_scheduler= 1;
set global event_scheduler= 1;
--sleep 1
--sleep 1
--replace_column 1 # 6 #
select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
show processlist;
select release_lock('ee_16407_2');
select release_lock('ee_16407_2');
--sleep 3
--sleep 3
--replace_column 1 # 6 #
select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
show processlist;
set global event_scheduler= 0;
set global event_scheduler= 0;
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"
...
@@ -143,12 +140,12 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode
...
@@ -143,12 +140,12 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
create event ee_16407_5 on schedule every 60 second do
create event ee_16407_5 on schedule every 60 second do
begin
begin
select get_lock('ee_16407_5', 60);
select get_lock('ee_16407_5', 60) /*ee_16407_5*/;
call events_test.ee_16407_5_pendant();
call events_test.ee_16407_5_pendant();
end|
end|
create event ee_16407_6 on schedule every 60 second do
create event ee_16407_6 on schedule every 60 second do
begin
begin
select get_lock('ee_16407_5', 60);
select get_lock('ee_16407_5', 60) /*ee_16407_6*/;
call events_test.ee_16407_6_pendant();
call events_test.ee_16407_6_pendant();
end|
end|
delimiter ;|
delimiter ;|
...
@@ -156,12 +153,12 @@ set sql_mode='ansi';
...
@@ -156,12 +153,12 @@ set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
select get_lock('ee_16407_5', 60);
set global event_scheduler= 1;
set global event_scheduler= 1;
--sleep 1
--sleep 1
--replace_column 1 # 6 #
--echo "Should have 2 locked processes"
show processlist;
select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('ee_16407_5');
select release_lock('ee_16407_5');
--sleep 3
--sleep 3
--replace_column 1 # 6 #
--echo "Should have 0 processes locked"
show processlist;
select /*5*/ user, host, db, command, state, info from information_schema.processlist where 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;