1--disable_warnings 2DROP TABLE IF EXISTS t1,t2,t3; 3--enable_warnings 4SET sql_mode='NO_ENGINE_SUBSTITUTION'; 5# Set Correct timezone to match result 6SET TIME_ZONE="+03:00"; 7CREATE TABLE t1(c1 DATE NOT NULL PRIMARY KEY); 8SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33 9INSERT INTO t1 (c1) VALUES(NOW()); 10INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); 11INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); 12INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); 13INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); 14SELECT * FROM t1 ORDER BY c1; 15DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); 16SELECT * FROM t1 ORDER BY c1; 17DROP TABLE t1; 18CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); 19SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33 20INSERT INTO t1 (c1) VALUES(NOW()); 21INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); 22INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); 23INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); 24INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); 25SELECT * FROM t1 ORDER BY c1; 26DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); 27SELECT * FROM t1 ORDER BY c1; 28DROP TABLE t1; 29CREATE TABLE t1(c1 DATETIME NOT NULL PRIMARY KEY); 30SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33 31INSERT INTO t1 (c1) VALUES(NOW()); 32INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); 33INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); 34INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); 35INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); 36SELECT * FROM t1 ORDER BY c1; 37DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); 38SELECT * FROM t1 ORDER BY c1; 39DROP TABLE t1; 40CREATE TABLE t1(c1 TIMESTAMP NOT NULL PRIMARY KEY); 41SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33 42INSERT INTO t1 (c1) VALUES(NOW()); 43INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); 44INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); 45INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); 46INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); 47SELECT * FROM t1 ORDER BY c1; 48DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); 49SELECT * FROM t1 ORDER BY c1; 50DROP TABLE t1; 51# Restore timezone to default 52SET TIME_ZONE= @@global.time_zone; 53SET sql_mode=default; 54