blob: 250e7894c78642bafc7719df9e59684ae9cebbed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
include/master-slave.inc
[connection master]
connection master;
SET GLOBAL event_scheduler=off;
CREATE TABLE t1 (a INT);
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
ERROR HY000: Event 'ev1' already exists
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11);
SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME STATUS EVENT_DEFINITION
ev1 ENABLED INSERT INTO t1 VALUES (11)
SET GLOBAL event_scheduler=on;
SET GLOBAL event_scheduler=off;
SELECT DISTINCT a FROM t1;
a
11
DELETE FROM t1;
# Syncing slave with master
connection slave;
SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME STATUS EVENT_DEFINITION
ev1 SLAVESIDE_DISABLED INSERT INTO t1 VALUES (11)
connection master;
DROP TABLE t1;
DROP EVENT ev1;
connection slave;
include/rpl_end.inc
|