mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
cf54bc182d
WL#1034 (Internal CRON) (not interesting for the Changelog) mysql-test/r/events.result: update result mysql-test/t/events.test: update test after pull after comit of fix for bug 16419
60 lines
2.6 KiB
Text
60 lines
2.6 KiB
Text
create database if not exists events_test;
|
|
use events_test;
|
|
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;
|
|
alter event event1 rename to event2 enable;
|
|
alter event event2 disable;
|
|
alter event event2 enable;
|
|
alter event event2 on completion not preserve;
|
|
alter event event2 on schedule every 1 year on completion preserve rename to event3 comment "new comment" do begin select 1; end__
|
|
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;
|
|
drop event event2;
|
|
create event e_43 on schedule every 1 second do set @a = 5;
|
|
set global event_scheduler = 1;
|
|
select sleep(2);
|
|
sleep(2)
|
|
0
|
|
alter event e_43 do alter event e_43 do set @a = 4;
|
|
select sleep(3);
|
|
sleep(3)
|
|
0
|
|
select db, name, body, status, interval_field, interval_value from mysql.event;
|
|
db name body status interval_field interval_value
|
|
events_test e_43 set @a = 4 ENABLED SECOND 1
|
|
drop event e_43;
|
|
select sleep(1);
|
|
sleep(1)
|
|
0
|
|
set global event_scheduler = 0;
|
|
create table t_event3 (a int, b float);
|
|
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("20010101", interval 5 minute) ends date_add("20151010", interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
|
|
set max_allowed_packet=128000000;
|
|
select count(*) from t_event3;
|
|
count(*)
|
|
0
|
|
drop event event3;
|
|
drop table t_event3;
|
|
create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
|
|
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 2017-01-01 00:00:00 DROP
|
|
drop event e_26;
|
|
create event e_26 on schedule at NULL disabled do set @a = 5;
|
|
ERROR HY000: Incorrect AT value: 'NULL'
|
|
create event e_26 on schedule at 'definitely not a datetime' disabled do set @a = 5;
|
|
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;
|
|
drop event задачка;
|
|
set event_scheduler=0;
|
|
ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
|
|
set global event_scheduler=2;
|
|
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
|
|
drop database events_test;
|