Commit 50baafeb authored by Matthias Leich's avatar Matthias Leich

Merge of bug fix into actual tree

parents c8ee385d d2603f9a
......@@ -59,7 +59,8 @@ begin
select get_lock('test_bug16407', 60);
end|
"Now if everything is fine the event has compiled and is locked"
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 /*1*/ user, host, db, info from information_schema.processlist
where info = 'select get_lock(\'test_bug16407\', 60)';
user host db info
root localhost events_test select get_lock('test_bug16407', 60)
select release_lock('test_bug16407');
......@@ -114,18 +115,18 @@ event_schema event_name sql_mode
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_4
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 /*2*/ user, host, db, info from information_schema.processlist
where info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60)
select release_lock('ee_16407_2');
release_lock('ee_16407_2')
1
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 /*3*/ user, host, db, info from information_schema.processlist
where info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info
event_scheduler localhost NULL NULL
set global event_scheduler= off;
select * from events_smode_test order by ev_name, a;
ev_name a
......@@ -164,7 +165,9 @@ select release_lock('ee_16407_5');
call events_test.ee_16407_6_pendant();
end|
"Should have 2 locked processes"
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 /*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;
user host db info
event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_5', 60)
......@@ -173,7 +176,9 @@ select release_lock('ee_16407_5');
release_lock('ee_16407_5')
1
"Should have 0 processes locked"
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 /*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
event_scheduler localhost NULL NULL
select * from events_smode_test order by ev_name, a;
......@@ -566,10 +571,9 @@ SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON;
CREATE TABLE event_log (id int KEY AUTO_INCREMENT,
ev_nm char(40), ev_cnt int,
ev_tm timestamp) ENGINE=MyISAM;
SET @ev_base_date = 20281224180000;
CREATE TABLE events_test.event_log
(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
ENGINE=MyISAM;
SET autocommit=0;
CREATE USER evtest1@localhost;
SET PASSWORD FOR evtest1@localhost = password('ev1');
......@@ -582,41 +586,40 @@ GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E3
GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
connection e1;
USE events_test;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
SET AUTOCOMMIT = 0;
SET @evname = 'ev_sched_1823';
SET @cnt = 0;
SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
IF @cnt < 6 THEN
INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
COMMIT;
END IF;
SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname;
SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
IF @cnt < 6 THEN
INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
ROLLBACK;
END IF;
END;|
Sleep till the first INSERT into events_test.event_log occured
SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
Expect 1
1
connection default;
DROP EVENT ev_sched_1823;
DROP USER evtest1@localhost;
USE test;
=====================================================================================
select id,ev_nm,ev_cnt from event_log order by id;
id ev_nm ev_cnt
1 ev_sched_1823 1
2 ev_sched_1823 2
3 ev_sched_1823 3
4 ev_sched_1823 4
5 ev_sched_1823 5
6 ev_sched_1823 6
DROP TABLE event_log;
Sleep 4 seconds
SELECT COUNT(*) INTO @row_cnt FROM events_test.event_log;
Sleep 4 seconds
SELECT COUNT(*) > @row_cnt AS "Expect 0" FROM events_test.event_log;
Expect 0
0
DROP EVENT events_test.ev_sched_1823;
DROP TABLE events_test.event_log;
SET GLOBAL event_scheduler = OFF;
SET GLOBAL event_scheduler= ON;
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
DO BEGIN
DO BEGIN
SELECT 1;
END;|
SET GLOBAL event_scheduler= OFF;
......@@ -736,3 +739,4 @@ select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name
drop event e1;
DROP DATABASE events_test;
SET GLOBAL event_scheduler = 'ON';
......@@ -13,4 +13,3 @@ federated_transactions : Bug#29523 Transactions do not work
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
events-bugs.test : Bug #39848, Bug #39863, Bug #39569, Bug #37774
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment