mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.
mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user