1221
1222
DROP EVENT ev1;
1222
1223
SET GLOBAL server_id = @old_server_id;
1226
# Bug#11751148: show events shows events in other schema
1229
CREATE DATABASE event_test12;
1231
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
1232
CREATE DATABASE event_test1;
1234
# Following show events should not show ev1
1236
DROP DATABASE event_test1;
1237
DROP DATABASE event_test12;
1240
--echo # Bug#12546938 (formerly known as bug#61005):
1241
--echo # CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
1244
SET GLOBAL event_scheduler = ON;
1247
DROP TABLE IF EXISTS table_bug12546938;
1248
DROP EVENT IF EXISTS event_Bug12546938;
1250
CREATE TABLE table_bug12546938 (i INT);
1254
--echo # Create an event which will be executed with a small delay
1255
--echo # and won't be automatically dropped after that.
1256
CREATE EVENT event_Bug12546938
1257
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
1260
INSERT INTO table_bug12546938 VALUES(1);
1264
--echo # Now try to create the same event using CREATE EVENT IF NOT EXISTS.
1265
--echo # A warning should be emitted. A new event should not be created nor
1266
--echo # the old event should be re-executed.
1267
CREATE EVENT IF NOT EXISTS event_bug12546938
1268
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
1271
INSERT INTO table_bug12546938 VALUES (1);
1277
--echo # Wait until at least one instance of event is executed.
1278
let $wait_condition= SELECT COUNT(*) FROM table_bug12546938;
1279
--source include/wait_condition.inc
1281
--echo # Check that only one instance of our event was executed.
1282
SELECT COUNT(*) FROM table_bug12546938;
1285
DROP EVENT IF EXISTS event_Bug12546938;
1286
DROP TABLE table_bug12546938;
1287
SET GLOBAL EVENT_SCHEDULER = OFF;
1290
# Bug#11764334 - 57156: ALTER EVENT CHANGES THE EVENT STATUS
1293
DROP DATABASE IF EXISTS event_test11764334;
1295
CREATE DATABASE event_test11764334;
1296
USE event_test11764334;
1297
CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
1298
--replace_column 9 # 10 #
1299
SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
1300
ALTER EVENT ev1 ON SCHEDULE EVERY 4 SECOND;
1301
--replace_column 9 # 10 #
1302
SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
1304
DROP DATABASE event_test11764334;
1224
1306
###########################################################################