mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / engines / funcs / t / up_calendar_range.test
blobd4aca03199d52254190c74bef11703ee1bd083a7
1 --disable_warnings
2 DROP TABLE IF EXISTS t1,t2,t3;
3 --enable_warnings
4 # Set Correct timezone to match result
5 SET TIME_ZONE="+03:00";
6 CREATE TABLE t1(c1 DATE NOT NULL);
7 SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
8 INSERT INTO t1 (c1) VALUES(NOW());
9 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
10 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01'));
11 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01'));
12 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01'));
13 --sorted_result
14 SELECT * FROM t1 ORDER BY c1;
15 UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01');
16 --sorted_result
17 SELECT * FROM t1 ORDER BY c1;
18 DROP TABLE t1;
19 CREATE TABLE t1(c1 TIME NOT NULL);
20 SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
21 INSERT INTO t1 (c1) VALUES(NOW());
22 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
23 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01'));
24 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01'));
25 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01'));
26 --sorted_result
27 SELECT * FROM t1 ORDER BY c1;
28 UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01');
29 --sorted_result
30 SELECT * FROM t1 ORDER BY c1;
31 DROP TABLE t1;
32 CREATE TABLE t1(c1 DATETIME NOT NULL);
33 SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
34 INSERT INTO t1 (c1) VALUES(NOW());
35 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
36 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01'));
37 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01'));
38 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01'));
39 --sorted_result
40 SELECT * FROM t1 ORDER BY c1;
41 UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01');
42 --sorted_result
43 SELECT * FROM t1 ORDER BY c1;
44 DROP TABLE t1;
45 CREATE TABLE t1(c1 TIMESTAMP NOT NULL);
46 SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
47 INSERT INTO t1 (c1) VALUES(NOW());
48 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
49 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01'));
50 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01'));
51 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01'));
52 --sorted_result
53 SELECT * FROM t1 ORDER BY c1;
54 UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01');
55 --sorted_result
56 SELECT * FROM t1 ORDER BY c1;
57 DROP TABLE t1;
58 # Restore timezone to default
59 SET TIME_ZONE= @@global.time_zone;