~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/t/events_bugs.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
857
857
DROP EVENT e1;
858
858
 
859
859
SET TIME_ZONE=@save_time_zone;
 
860
SET TIMESTAMP=DEFAULT;
860
861
 
861
862
#
862
863
# START - BUG#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
1221
1222
DROP EVENT ev1;
1222
1223
SET GLOBAL server_id = @old_server_id;
1223
1224
 
 
1225
#
 
1226
# Bug#11751148: show events shows events in other schema
 
1227
#
 
1228
 
 
1229
CREATE DATABASE event_test12;
 
1230
USE event_test12;
 
1231
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
 
1232
CREATE DATABASE event_test1;
 
1233
USE event_test1;
 
1234
# Following show events should not show ev1
 
1235
SHOW EVENTS;
 
1236
DROP DATABASE event_test1;
 
1237
DROP DATABASE event_test12;
 
1238
 
 
1239
--echo #
 
1240
--echo # Bug#12546938 (formerly known as bug#61005):
 
1241
--echo # CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
 
1242
--echo #
 
1243
USE events_test;
 
1244
SET GLOBAL event_scheduler = ON;
 
1245
 
 
1246
--disable_warnings
 
1247
DROP TABLE IF EXISTS table_bug12546938;
 
1248
DROP EVENT IF EXISTS event_Bug12546938;
 
1249
--enable_warnings
 
1250
CREATE TABLE table_bug12546938 (i INT); 
 
1251
 
 
1252
delimiter |;
 
1253
 
 
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
 
1258
ENABLE DO
 
1259
BEGIN 
 
1260
  INSERT INTO table_bug12546938 VALUES(1);
 
1261
END
 
1262
|
 
1263
 
 
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
 
1269
ENABLE DO
 
1270
BEGIN
 
1271
  INSERT INTO table_bug12546938 VALUES (1);
 
1272
END
 
1273
|
 
1274
 
 
1275
delimiter ;|
 
1276
 
 
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
 
1280
 
 
1281
--echo # Check that only one instance of our event was executed.
 
1282
SELECT COUNT(*) FROM table_bug12546938;
 
1283
 
 
1284
--echo # Clean-up.
 
1285
DROP EVENT IF EXISTS event_Bug12546938;
 
1286
DROP TABLE table_bug12546938;
 
1287
SET GLOBAL EVENT_SCHEDULER = OFF;
 
1288
 
 
1289
#
 
1290
# Bug#11764334 - 57156: ALTER EVENT CHANGES THE EVENT STATUS
 
1291
#
 
1292
--disable_warnings
 
1293
DROP DATABASE IF EXISTS event_test11764334;
 
1294
--enable_warnings
 
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';
 
1303
DROP EVENT ev1;
 
1304
DROP DATABASE event_test11764334;
 
1305
USE test; 
1224
1306
###########################################################################
1225
1307
#
1226
1308
# End of tests