WL#3629 - Replication of Invocation and Invoked Features

  
This patch corrects errors that occurred in a local manual merge.
It adds the originator column in the results of the SHOW EVENTS command
for a series of tests.

The only code change is to correct references to the classname in
enums.
parent a591514a
......@@ -229,10 +229,10 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1
ALTER TABLE mysql.event ADD dummy INT FIRST;
SHOW EVENTS;
ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted
ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 19. Table probably corrupted
ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST;
SHOW EVENTS;
ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 18. Table probably corrupted
ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 19. Table probably corrupted
ALTER TABLE mysql.event DROP dummy2;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
......@@ -281,7 +281,7 @@ SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log.
ALTER TABLE mysql.event DROP comment, DROP starts;
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
ERROR HY000: Column count of mysql.event is wrong. Expected 17, found 15. Table probably corrupted
ERROR HY000: Column count of mysql.event is wrong. Expected 18, found 16. Table probably corrupted
DROP TABLE mysql.event;
CREATE TABLE mysql.event like event_like;
INSERT INTO mysql.event SELECT * FROM event_like;
......
......@@ -30,7 +30,7 @@ create event e_55 on schedule at 20000101000000 do drop table t;
Warnings:
Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starts 10000101000000 do drop table t' at line 1
create event e_55 on schedule at 20200101000000 ends 10000101000000 do drop table t;
......
......@@ -7,30 +7,30 @@ 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;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 DAY 2005-12-31 23:58:59 NULL ENABLED 1
SET TIME_ZONE= '-01:00';
ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:00';
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost -01:00 RECURRING NULL 1 DAY 2000-01-01 00:00:00 NULL ENABLED 1
SET TIME_ZONE= '+02:00';
ALTER EVENT e1 ON SCHEDULE AT '2000-01-02 00:00:00'
ON COMPLETION PRESERVE DISABLE;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost +02:00 ONE TIME 2000-01-02 00:00:00 NULL NULL NULL NULL DISABLED 1
SET TIME_ZONE= '-03:00';
ALTER EVENT e1 ON SCHEDULE EVERY 1 DAY ENDS '2030-01-03 00:00:00'
ON COMPLETION PRESERVE DISABLE;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1
SET TIME_ZONE= '+04:00';
ALTER EVENT e1 DO SELECT 2;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1
DROP EVENT e1;
SET TIME_ZONE='+05:00';
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
......@@ -44,15 +44,15 @@ SET TIME_ZONE='+00:00';
CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
SELECT 1;
SELECT * FROM INFORMATION_SCHEMA.EVENTS;
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
NULL mysqltest_db1 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
NULL mysqltest_db1 e2 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:59:00 2005-12-31 23:59:00 NULL
NULL mysqltest_db1 e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL
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
NULL mysqltest_db1 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
NULL mysqltest_db1 e2 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:59:00 2005-12-31 23:59:00 NULL 1
NULL mysqltest_db1 e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED
mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED
mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
SHOW CREATE EVENT e1;
Event sql_mode time_zone Create Event
e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1
......@@ -92,10 +92,10 @@ SELECT 1;
Warnings:
Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED
mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED
mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
mysqltest_db1 e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1
The following should succeed giving a warning.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE;
......@@ -128,15 +128,15 @@ CREATE EVENT e8 ON SCHEDULE AT '1999-01-01 00:00:00'
DO
SELECT 1;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED
mysqltest_db1 e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED
mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED
mysqltest_db1 e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED
mysqltest_db1 e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED
mysqltest_db1 e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED
mysqltest_db1 e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED
mysqltest_db1 e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
mysqltest_db1 e1 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
mysqltest_db1 e2 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1
mysqltest_db1 e3 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
mysqltest_db1 e4 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
mysqltest_db1 e5 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1
mysqltest_db1 e6 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 NULL ENABLED 1
mysqltest_db1 e7 root@localhost +00:00 RECURRING NULL 1 HOUR 1999-01-01 00:00:00 1999-01-02 00:00:00 DISABLED 1
mysqltest_db1 e8 root@localhost +00:00 ONE TIME 1999-01-01 00:00:00 NULL NULL NULL NULL DISABLED 1
DROP EVENT e8;
DROP EVENT e7;
DROP EVENT e6;
......
......@@ -3440,8 +3440,8 @@ use first;
set time_zone = 'UTC';
create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
show create event ee1;
Event sql_mode time_zone Create Event
ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5
......@@ -3449,26 +3449,26 @@ drop database first;
create database second;
use second;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
show create event ee1;
Event sql_mode time_zone Create Event
ee1 NO_AUTO_VALUE_ON_ZERO UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED
second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED
second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
second ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1
second ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1
drop database second;
create database third;
use third;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED
third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED
third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
third ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1
third ee2 root@localhost UTC ONE TIME 2018-12-31 21:01:23 NULL NULL NULL NULL ENABLED 1
third ee3 root@localhost UTC ONE TIME 2030-12-31 22:01:23 NULL NULL NULL NULL ENABLED 1
drop database third;
set time_zone = 'SYSTEM';
use test;
......
......@@ -1968,11 +1968,11 @@ prepare abc from "show master logs";
deallocate prepare abc;
create procedure proc_1() show events;
call proc_1();
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
call proc_1();
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
call proc_1();
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
drop procedure proc_1;
create function func_1() returns int begin show events; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
......@@ -1982,11 +1982,11 @@ drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "show events";
execute abc;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
execute abc;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
execute abc;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
deallocate prepare abc;
drop procedure if exists a;
create procedure a() select 42;
......
......@@ -683,12 +683,12 @@ INSERT INTO t1 VALUES(1, 'test1');
CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1;
==========MASTER==========
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
test_rpl e1 root@localhost RECURRING NULL 1 SECOND # # ENABLED
==========SLAVE===========
USE test_rpl;
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
......@@ -742,12 +742,12 @@ a b
ALTER EVENT e1 RENAME TO e2;
==========MASTER==========
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
test_rpl e2 root@localhost RECURRING NULL 1 SECOND # # ENABLED
==========SLAVE===========
USE test_rpl;
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
......@@ -776,11 +776,11 @@ a b
DROP EVENT e2;
==========MASTER==========
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
==========SLAVE===========
USE test_rpl;
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator
DELETE FROM t1;
DELETE FROM t2;
......
......@@ -244,7 +244,7 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc)
if (ltime_utc >= (my_time_t) thd->query_start())
return;
if (on_completion == ON_COMPLETION_DROP)
if (on_completion == Event_basic::ON_COMPLETION_DROP)
{
switch (thd->lex->sql_command) {
case SQLCOM_CREATE_EVENT:
......@@ -261,9 +261,9 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc)
do_not_create= TRUE;
}
else if (status == ENABLED)
else if (status == Event_basic::ENABLED)
{
status= DISABLED;
status= Event_basic::DISABLED;
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_EVENT_EXEC_TIME_IN_THE_PAST,
ER(ER_EVENT_EXEC_TIME_IN_THE_PAST));
......
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