-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Barkov
committed
Feb 27, 2015
1 parent
77806da
commit 2d01907
Showing
12 changed files
with
211 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30'); | ||
SET GLOBAL event_scheduler=off; | ||
CREATE TABLE t1 (a INT); | ||
CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db1; | ||
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS | ||
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10); | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME EVENT_DEFINITION | ||
ev1 INSERT INTO t1 VALUES (10) | ||
SET GLOBAL event_scheduler=on; | ||
SELECT DISTINCT a FROM t1; | ||
a | ||
10 | ||
SET GLOBAL event_scheduler=off; | ||
DELETE FROM t1; | ||
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11); | ||
ERROR HY000: Event 'ev1' already exists | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME EVENT_DEFINITION | ||
ev1 INSERT INTO t1 VALUES (10) | ||
CREATE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (12); | ||
Warnings: | ||
Note 1537 Event 'ev1' already exists | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME EVENT_DEFINITION | ||
ev1 INSERT INTO t1 VALUES (10) | ||
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (13); | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME EVENT_DEFINITION | ||
ev1 INSERT INTO t1 VALUES (13) | ||
SET GLOBAL event_scheduler=on; | ||
SELECT DISTINCT a FROM t1; | ||
a | ||
13 | ||
SET GLOBAL event_scheduler=off; | ||
DELETE FROM t1; | ||
DROP EVENT IF EXISTS ev1; | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME EVENT_DEFINITION | ||
DROP EVENT IF EXISTS ev1; | ||
Warnings: | ||
Note 1305 Event ev1 does not exist | ||
DROP EVENT ev1; | ||
ERROR HY000: Unknown event 'ev1' | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME EVENT_DEFINITION | ||
DROP TABLE t1; | ||
SET timestamp=DEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
include/master-slave.inc | ||
[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 | ||
SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
EVENT_NAME STATUS EVENT_DEFINITION | ||
ev1 SLAVESIDE_DISABLED INSERT INTO t1 VALUES (11) | ||
DROP TABLE t1; | ||
DROP EVENT ev1; | ||
include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--source include/master-slave.inc | ||
|
||
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); | ||
--error ER_EVENT_ALREADY_EXISTS | ||
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11); | ||
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; | ||
|
||
SET GLOBAL event_scheduler=on; | ||
let $wait_condition= SELECT count(*)>0 FROM t1; | ||
--source include/wait_condition.inc | ||
SET GLOBAL event_scheduler=off; | ||
SELECT DISTINCT a FROM t1; | ||
DELETE FROM t1; | ||
|
||
--echo # Syncing slave with master | ||
sync_slave_with_master; | ||
SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
connection master; | ||
DROP TABLE t1; | ||
DROP EVENT ev1; | ||
sync_slave_with_master; | ||
--source include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--source include/not_embedded.inc | ||
|
||
SET timestamp=UNIX_TIMESTAMP('2014-11-01 10:20:30'); | ||
SET GLOBAL event_scheduler=off; | ||
|
||
CREATE TABLE t1 (a INT); | ||
|
||
--error ER_WRONG_USAGE | ||
CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db1; | ||
|
||
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10); | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
SET GLOBAL event_scheduler=on; | ||
let $wait_condition= SELECT count(*)>0 FROM t1; | ||
--source include/wait_condition.inc | ||
SELECT DISTINCT a FROM t1; | ||
SET GLOBAL event_scheduler=off; | ||
DELETE FROM t1; | ||
|
||
--error ER_EVENT_ALREADY_EXISTS | ||
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (11); | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
CREATE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (12); | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
CREATE OR REPLACE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (13); | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
|
||
SET GLOBAL event_scheduler=on; | ||
let $wait_condition= SELECT count(*)>0 FROM t1; | ||
--source include/wait_condition.inc | ||
SELECT DISTINCT a FROM t1; | ||
SET GLOBAL event_scheduler=off; | ||
DELETE FROM t1; | ||
|
||
DROP EVENT IF EXISTS ev1; | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
DROP EVENT IF EXISTS ev1; | ||
--error ER_EVENT_DOES_NOT_EXIST | ||
DROP EVENT ev1; | ||
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS; | ||
|
||
DROP TABLE t1; | ||
|
||
SET timestamp=DEFAULT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters