Commit c90ffae0 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Update upstream source from tag 'upstream/10.1.39'

Update to upstream version '10.1.39'
with Debian dir b02cce09df65b5e8c30006c7cfbae4ad19f48522
parents 81524620 7e54c6cf
......@@ -2327,6 +2327,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
ujis_japanese_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
......@@ -2474,6 +2480,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
ujis_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
......
......@@ -669,6 +669,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf16_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
SET NAMES latin1;
SET collation_connection='utf16_bin';
create table t1 select repeat('a',4000) a;
......@@ -806,6 +812,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf16_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
select hex(substr(_utf16 0x00e400e50068,1));
hex(substr(_utf16 0x00e400e50068,1))
00E400E50068
......
......@@ -2952,6 +2952,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf16_unicode_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......
......@@ -713,6 +713,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf16le_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
SET NAMES utf8, collation_connection='utf16le_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
......@@ -849,6 +855,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf16le_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
#
# Bug#10344 Some string functions fail for UCS2
#
......
......@@ -668,6 +668,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf32_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
SET NAMES latin1;
SET collation_connection='utf32_bin';
create table t1 select repeat('a',4000) a;
......@@ -805,6 +811,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf32_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
select hex(substr(_utf32 0x000000e4000000e500000068,1));
hex(substr(_utf32 0x000000e4000000e500000068,1))
000000E4000000E500000068
......
......@@ -2952,6 +2952,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf32_unicode_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......
......@@ -1032,6 +1032,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......@@ -1263,6 +1269,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
......@@ -1032,6 +1032,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......@@ -1284,6 +1290,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
......@@ -971,6 +971,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......@@ -1183,6 +1189,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=heap DEFAULT CHARSET=latin1;
......
......@@ -1032,6 +1032,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......@@ -1244,6 +1250,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
......
......@@ -1032,6 +1032,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_general_ci
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
......@@ -1244,6 +1250,12 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SELECT @@collation_connection;
@@collation_connection
utf8mb4_bin
SELECT '\%b' LIKE '%\%';
'\%b' LIKE '%\%'
0
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
This diff is collapsed.
This diff is collapsed.
......@@ -12,7 +12,11 @@ GRANT EVENT ON db_x.* TO pauline@localhost;
USE db_x;
CREATE TABLE x_table(a int);
CREATE EVENT e_x1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db_x;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e_x2 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE x_table;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW DATABASES LIKE 'db_x';
Database (db_x)
db_x
......@@ -34,6 +38,8 @@ drop event if exists event1;
Warnings:
Note 1305 Event event1 does not exist
create event event1 on schedule every 15 minute starts now() ends date_add(now(), interval 5 hour) DO begin end;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event event1 rename to event2 enable;
alter event event2 disable;
alter event event2 enable;
......@@ -42,15 +48,19 @@ alter event event2 on schedule every 1 year on completion preserve rename to eve
alter event event3 rename to event2;
drop event event2;
create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
drop event event2;
CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT interval_field, interval_value, body FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
interval_field interval_value body
SECOND 10 SELECT 1
SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
execute_at IS NULL starts IS NULL ends IS NULL comment
1 0 1
ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02';
ALTER EVENT event_starts_test ON SCHEDULE AT '1970-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE;
SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
execute_at IS NULL starts IS NULL ends IS NULL comment
0 1 1
......@@ -63,7 +73,9 @@ SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.even
execute_at IS NULL starts IS NULL ends IS NULL comment
0 1 1
DROP EVENT event_starts_test;
CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2;
CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '1970-01-02 00:00:00' ENDS '1970-01-03 00:00:00' ON COMPLETION PRESERVE DISABLE DO SELECT 2;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
execute_at IS NULL starts IS NULL ends IS NULL comment
1 0 0
......@@ -78,6 +90,8 @@ execute_at IS NULL starts IS NULL ends IS NULL comment
DROP EVENT event_starts_test;
create table test_nested(a int);
create event e_43 on schedule every 1 second do set @a = 5;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event e_43 do alter event e_43 do set @a = 4;
ERROR HY000: Recursion of EVENT DDL statements is forbidden when body is present
alter event e_43 do
......@@ -106,6 +120,8 @@ alter event non_existant rename to non_existant_too;
ERROR HY000: Unknown event 'non_existant'
set global event_scheduler = off;
create event existant on schedule at now() + interval 1 year do select 12;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event non_existant rename to existant;
ERROR HY000: Event 'existant' already exists
alter event existant rename to events_test.existant;
......@@ -116,6 +132,8 @@ drop event if exists event3;
Warnings:
Note 1305 Event event3 does not exist
create event event3 on schedule every 50 + 10 minute starts date_add(curdate(), interval 5 minute) ends date_add(curdate(), interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select count(*) from t_event3;
count(*)
0
......@@ -123,79 +141,117 @@ drop event event3;
drop table t_event3;
set names utf8;
CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root6;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root6 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root7 on schedule every 2 year do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root7;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root7 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root8 on schedule every '2:5' year_month do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root8;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root8 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root8_1 on schedule every '2:15' year_month do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root8_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root8_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root9;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root9 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root10 on schedule every '20:5' day_hour do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root10;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root10 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root11 on schedule every '20:25' day_hour do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root11;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root11 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root12 on schedule every '20:25' hour_minute do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root12;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root12 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root13 on schedule every '25:25' hour_minute do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root13;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root13 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root13_1 on schedule every '11:65' hour_minute do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root13_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root13_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root14 on schedule every '35:35' minute_second do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root14;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root14 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root15 on schedule every '35:66' minute_second do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root15;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root15 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root16 on schedule every '35:56' day_minute do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root16;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root16 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root17 on schedule every '35:12:45' day_minute do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root17;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root17 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root17_1 on schedule every '35:25:65' day_minute do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root17_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root17_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root18 on schedule every '35:12:45' hour_second do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root18;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root18 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root19 on schedule every '15:59:85' hour_second do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root19;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root19 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root20 on schedule every '50:20:12:45' day_second do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT root20;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
root20 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
set names cp1251;
create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW CREATE EVENT ðóóò21;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
ðóóò21 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'това е 1251 коментар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
......@@ -255,6 +311,8 @@ set names latin1;
Create a test event. Only event metadata is relevant,
the actual schedule and body are not.
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -301,6 +359,8 @@ SET GLOBAL event_scheduler=OFF;
ALTER TABLE mysql.event DROP dummy;
DROP EVENT intact_check;
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
Now let's add a column to the first position: the server
expects to see event schema name there
......@@ -344,6 +404,8 @@ Clean up
ALTER TABLE mysql.event DROP dummy;
DELETE FROM mysql.event;
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
Back up the table, further changes are not reversible
CREATE TABLE event_like LIKE mysql.event;
INSERT INTO event_like SELECT * FROM mysql.event;
......@@ -442,6 +504,8 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
#
CREATE EVENT ev1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
ALTER EVENT ev1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
CREATE TABLE event_original LIKE mysql.event;
......@@ -475,6 +539,8 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
#
CREATE TABLE t1 (a INT);
CREATE EVENT ev1 ON SCHEDULE EVERY 5 SECOND DO DELETE FROM t1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test ev1 root@localhost SYSTEM RECURRING NULL 5 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -484,6 +550,8 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
events_test ev1 root@localhost SYSTEM RECURRING NULL 5 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT ev1;
CREATE EVENT ev1 ON SCHEDULE EVERY 5 SECOND DO DELETE FROM t1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test ev1 root@localhost SYSTEM RECURRING NULL 5 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......
......@@ -3,6 +3,8 @@ drop database if exists events_test;
create database events_test;
use events_test;
create event e_26 on schedule at '2037-01-01 00:00:00' disable do set @a = 5;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
events_test e_26 set @a = 5 root@localhost 2037-01-01 00:00:00 DROP
......@@ -13,6 +15,8 @@ create event e_26 on schedule at 'definitely not a datetime' disable do set @a =
ERROR HY000: Incorrect AT value: 'definitely not a datetime'
set names utf8;
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
drop event задачка;
"DISABLE the scheduler. Testing that it does not work when the variable is 0"
set global event_scheduler=off;
......@@ -22,6 +26,8 @@ select get_lock("test_lock1", 20);
get_lock("test_lock1", 20)
1
create event закачка on schedule every 10 hour do select get_lock("test_lock1", 20);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
"Should return 1 row"
select definer, name, db from mysql.event;
definer name db
......@@ -94,22 +100,30 @@ on schedule every 10 hour
disable
do
select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space';
event_schema event_name definer event_definition
events_test white_space root@localhost select 1
drop event white_space;
create event white_space on schedule every 10 hour disable do
select 2;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space';
event_schema event_name definer event_definition
events_test white_space root@localhost select 2
drop event white_space;
create event white_space on schedule every 10 hour disable do select 3;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select event_schema, event_name, definer, event_definition from information_schema.events where event_name='white_space';
event_schema event_name definer event_definition
events_test white_space root@localhost select 3
drop event white_space;
create event e1 on schedule every 1 year do set @a = 5;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
create table t1 (s1 int);
create trigger t1_ai after insert on t1 for each row show create event e1;
ERROR 0A000: Not allowed to return a result set from a trigger
......@@ -126,6 +140,8 @@ LOCK TABLES mode.
create table t1 (a int);
create event e1 on schedule every 10 hour do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
lock table t1 read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
......@@ -229,6 +245,8 @@ Events in sub-statements, events and prelocking
create event e1 on schedule every 10 hour do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
create function f1() returns int
begin
show create event e1;
......@@ -321,6 +339,8 @@ drop table t1|
drop event e1|
set names utf8;
create event имя_события_в_кодировке_утф8_длиной_больше_чем_48 on schedule every 2 year do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select EVENT_NAME from information_schema.events
where event_schema='test';
EVENT_NAME
......@@ -333,6 +353,8 @@ create event event_35981 on schedule every 6 month on completion preserve
disable
do
select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
The following SELECTs should all give 1
select count(*) from information_schema.events
where event_schema = database() and event_name = 'event_35981' and
......@@ -367,6 +389,8 @@ drop event event_35981;
create event event_35981 on schedule every 6 month disable
do
select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select count(*) from information_schema.events
where event_schema = database() and event_name = 'event_35981' and
on_completion = 'NOT PRESERVE';
......@@ -377,6 +401,8 @@ create event event_35981 on schedule every 1 hour starts current_timestamp
on completion not preserve
do
select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
ends '1999-01-02 00:00:00';
ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future.
......@@ -385,6 +411,8 @@ create event event_35981 on schedule every 1 hour starts current_timestamp
on completion not preserve
do
select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
ends '1999-01-02 00:00:00' on completion preserve;
Warnings:
......@@ -394,6 +422,8 @@ create event event_35981 on schedule every 1 hour starts current_timestamp
on completion preserve
do
select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
ends '1999-01-02 00:00:00';
Warnings:
......
......@@ -11,16 +11,22 @@ VARIABLE_NAME VARIABLE_VALUE
EVENT_SCHEDULER ON
SET GLOBAL event_scheduler = 'OFF';
CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2;
ERROR HY000: Event 'Lower_case' already exists
DROP EVENT Lower_case;
SET NAMES cp1251;
CREATE EVENT __1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT __1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200;
ERROR HY000: Event '__1251' already exists
DROP EVENT __1251;
SET NAMES utf8;
CREATE EVENT долен_регистър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT ДОЛЕН_регистър_утф8 ON SCHEDULE EVERY 4 YEAR DO SELECT 400;
ERROR HY000: Event 'ДОЛЕН_регистър_утф8' already exists
DROP EVENT ДОЛЕН_регистър_утф8;
......@@ -204,6 +210,8 @@ create user mysqltest_user1@localhost;
create database mysqltest_db1;
grant event on events_test.* to mysqltest_user1@localhost;
create event mysqltest_user1 on schedule every 10 second do select 42;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
alter event mysqltest_user1 rename to mysqltest_db1.mysqltest_user1;
ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db1'
"Let's test now rename when there is no select DB"
......@@ -229,6 +237,8 @@ ERROR 42000: CREATE/ALTER EVENT does not support subqueries or stored functions.
drop event if exists e_16;
drop procedure if exists p_16;
create event e_16 on schedule every 1 second do set @a=5;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
create procedure p_16 () alter event e_16 on schedule every @a second;
set @a = null;
call p_16();
......@@ -342,11 +352,15 @@ DROP USER mysqltest_u1@localhost;
CREATE USER mysqltest_u1@localhost;
GRANT EVENT ON events_test.* TO mysqltest_u1@localhost;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 root@localhost
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 root@localhost
......@@ -356,22 +370,30 @@ event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER() EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 root@localhost
DROP EVENT e1;
CREATE DEFINER=mysqltest_u1@localhost EVENT e1 ON SCHEDULE EVERY 1 DAY DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
......@@ -382,6 +404,8 @@ event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE DEFINER=CURRENT_USER() EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
......@@ -396,6 +420,8 @@ SET @save_time_zone= @@TIME_ZONE;
SET TIME_ZONE= '+00:00';
SET TIMESTAMP= UNIX_TIMESTAMP('2005-12-31 23:58:59');
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -425,14 +451,20 @@ DROP EVENT e1;
SET TIME_ZONE='+05:00';
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SET TIMESTAMP= @@TIMESTAMP + 1;
SET TIME_ZONE='-05:00';
CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SET TIMESTAMP= @@TIMESTAMP + 1;
SET TIME_ZONE='+00:00';
CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -497,26 +529,34 @@ DO
SELECT 1;
Warnings:
Note 1544 Event execution time is in the past. Event has been disabled
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00'
ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
Note 1544 Event execution time is in the past. Event has been disabled
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
The following should succeed without warnings.
ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00';
ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE;
CREATE EVENT e6 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e7 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DISABLE
DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00'
ON COMPLETION PRESERVE DISABLE
DO
SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -658,6 +698,8 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can
#
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
ALTER EVENT e1 COMMENT 'comment';
......@@ -670,7 +712,11 @@ SET GLOBAL READ_ONLY = 0;
#
CREATE EVENT e1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND DO SET @a = 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO SET @a = 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT
event_name,
......@@ -730,6 +776,8 @@ drop procedure if exists p;
set @old_mode= @@sql_mode;
set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
create event e1 on schedule every 1 day do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
select @@sql_mode into @full_mode;
set @@sql_mode= @old_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
......@@ -743,6 +791,8 @@ SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS;
event_name originator
ev1 4294967295
......@@ -751,6 +801,8 @@ SET GLOBAL server_id = @old_server_id;
CREATE DATABASE event_test12;
USE event_test12;
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE DATABASE event_test1;
USE event_test1;
SHOW EVENTS;
......@@ -800,6 +852,8 @@ DROP DATABASE IF EXISTS event_test11764334;
CREATE DATABASE event_test11764334;
USE event_test11764334;
CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 3 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......
CREATE DATABASE IF NOT EXISTS events_test;
use events_test;
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -37,7 +39,11 @@ Let's create some new events from the name of ev_test@localhost
CREATE EVENT one_event ON SCHEDULE EVERY 20 SECOND DO SELECT 123;
ERROR HY000: Event 'one_event' already exists
CREATE EVENT two_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION NOT PRESERVE COMMENT "two event" DO SELECT 123;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT three_event ON SCHEDULE EVERY 20 SECOND ON COMPLETION PRESERVE COMMENT "three event" DO SELECT 123;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
"Now we should see 3 events:";
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
......@@ -55,6 +61,8 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
GRANT EVENT ON events_test2.* TO ev_test@localhost;
USE events_test2;
CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
USE events_test;
"We should see 4 events : one_event, two_event, three_event & four_event"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
......@@ -73,6 +81,8 @@ def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SEC
CREATE DATABASE events_test2;
USE events_test2;
CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
"Should see 4 events - one, two, three & five"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
......
......@@ -6,10 +6,16 @@ use events_test;
create table execution_log(name char(10));
create event abc1 on schedule every 1 second do
insert into execution_log value('abc1');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
create event abc2 on schedule every 1 second do
insert into execution_log value('abc2');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
create event abc3 on schedule every 1 second do
insert into execution_log value('abc3');
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
create table event_like like mysql.event;
insert into event_like select * from mysql.event;
alter table mysql.event
......@@ -20,25 +26,25 @@ select @@event_scheduler;
@@event_scheduler
OFF
show events;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
select event_name from information_schema.events;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
show create event intact_check;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
drop event no_such_event;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
create event intact_check_1 on schedule every 5 hour do select 5;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
alter event intact_check_1 on schedule every 8 hour do select 8;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
alter event intact_check_1 rename to intact_check_2;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
drop event intact_check_1;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
drop event intact_check_2;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
drop event intact_check;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Cannot proceed, because event scheduler is disabled
set global event_scheduler=on;
ERROR HY000: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
set global event_scheduler=off;
......
......@@ -15,6 +15,8 @@ create table t1 (a varchar(255)) engine=innodb;
begin work;
insert into t1 (a) values ("OK: create event");
create event e1 on schedule every 1 day do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
rollback work;
select * from t1;
a
......@@ -60,11 +62,14 @@ OK: drop event if exists
delete from t1;
commit work;
create event e1 on schedule every 1 day do select 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
begin work;
insert into t1 (a) values ("OK: create event if not exists");
create event if not exists e1 on schedule every 2 day do select 2;
Warnings:
Note 1537 Event 'e1' already exists
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
rollback work;
select * from t1;
a
......@@ -96,6 +101,8 @@ OK: alter event rename: rename to same name
delete from t1;
commit work;
create event e2 on schedule every 3 day do select 3;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
begin work;
insert into t1 (a) values ("OK: alter event rename: destination exists");
alter event e2 rename to e1;
......@@ -126,6 +133,8 @@ DROP EVENT IF EXISTS e1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT);
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
START TRANSACTION;
INSERT INTO t1 VALUES (1);
SAVEPOINT A;
......
......@@ -85,6 +85,8 @@ insert into t1_temp values (1);
return 0;
end|
create event e1 on schedule every 1 minute do begin end;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
#
# Test compatibility of FLUSH TABLES WITH READ LOCK
# with various statements.
......
Supports Markdown
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