419
419
ALTER EVENT e1 DO SELECT 2;
421
421
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
422
events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
422
events_test e1 root@localhost -03:00 RECURRING NULL 1 DAY 2005-12-31 20:58:59 2030-01-03 00:00:00 DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
424
424
SET TIME_ZONE='+05:00';
425
425
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
749
750
SET GLOBAL server_id = @old_server_id;
751
CREATE DATABASE event_test12;
753
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
754
CREATE DATABASE event_test1;
757
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
758
DROP DATABASE event_test1;
759
DROP DATABASE event_test12;
761
# Bug#12546938 (formerly known as bug#61005):
762
# CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
765
SET GLOBAL event_scheduler = ON;
766
DROP TABLE IF EXISTS table_bug12546938;
767
DROP EVENT IF EXISTS event_Bug12546938;
768
CREATE TABLE table_bug12546938 (i INT);
769
# Create an event which will be executed with a small delay
770
# and won't be automatically dropped after that.
771
CREATE EVENT event_Bug12546938
772
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
775
INSERT INTO table_bug12546938 VALUES(1);
778
# Now try to create the same event using CREATE EVENT IF NOT EXISTS.
779
# A warning should be emitted. A new event should not be created nor
780
# the old event should be re-executed.
781
CREATE EVENT IF NOT EXISTS event_bug12546938
782
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
785
INSERT INTO table_bug12546938 VALUES (1);
789
Note 1537 Event 'event_bug12546938' already exists
790
# Wait until at least one instance of event is executed.
791
# Check that only one instance of our event was executed.
792
SELECT COUNT(*) FROM table_bug12546938;
796
DROP EVENT IF EXISTS event_Bug12546938;
797
DROP TABLE table_bug12546938;
798
SET GLOBAL EVENT_SCHEDULER = OFF;
799
DROP DATABASE IF EXISTS event_test11764334;
800
CREATE DATABASE event_test11764334;
801
USE event_test11764334;
802
CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
803
SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
804
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
805
event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 3 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
806
ALTER EVENT ev1 ON SCHEDULE EVERY 4 SECOND;
807
SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
808
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
809
event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 4 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
811
DROP DATABASE event_test11764334;
750
813
DROP DATABASE events_test;
751
814
SET GLOBAL event_scheduler= 'ON';
752
815
SET @@global.concurrent_insert= @concurrent_insert;