mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / timezone.test
blob157b18f57faeb2f3428b379a20da0cdfe20113cb
2 # Test of SYSTEM time zone handling ( for my_system_gmt_sec()).
3 # This script must be run with TZ=MET
5 -- require r/have_met_timezone.require
6 disable_query_log;
7 select FROM_UNIXTIME(24*3600);
8 enable_query_log;
10 # Initialization
11 --disable_warnings
12 DROP TABLE IF EXISTS t1;
13 --enable_warnings
15 # The following is because of daylight saving time
16 --replace_result MEST MET
17 show variables like "system_time_zone";
20 # Test unix timestamp
22 select @a:=FROM_UNIXTIME(1);
23 select unix_timestamp(@a);
26 # Test of some values, including some with daylight saving time
29 CREATE TABLE t1 (ts int);
30 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
31 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
32 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 03:00'));
33 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
34 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
35 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
36 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 02:59:59'));
37 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 03:00:00'));
38 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 03:59:59'));
39 INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
41 SELECT ts,from_unixtime(ts) FROM t1;
42 DROP TABLE t1;
46 # Test of warning for spring time-gap values for system time zone
48 CREATE TABLE t1 (ts timestamp);
49 INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'),
50                            ('2003-03-30 02:59:59'),
51                            ('2003-03-30 03:00:00');
52 DROP TABLE t1;
55 # Test for fix for Bug#2523 Check that boundary dates are processed
56 # correctly.
58 select unix_timestamp('1970-01-01 01:00:00'), 
59        unix_timestamp('1970-01-01 01:00:01'),
60        unix_timestamp('2038-01-19 04:14:07'),
61        unix_timestamp('2038-01-19 04:14:08');
63 # End of 4.1 tests