~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Test of SYSTEM time zone handling ( for my_system_gmt_sec()).
3
# This script must be run with TZ=MET
4
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
5
#-- require r/have_met_timezone.require
1 by brian
clean slate
6
disable_query_log;
642.1.36 by Lee
enable temp_table, timezone and timezone4 tests, timezone currently fails due to bug 309403
7
# Drizzle bug #309403 - returning wrong value for FROM_UNIXTIME
1 by brian
clean slate
8
select FROM_UNIXTIME(24*3600);
9
enable_query_log;
10
11
# Initialization
12
--disable_warnings
13
DROP TABLE IF EXISTS t1;
14
--enable_warnings
15
16
# The following is because of daylight saving time
17
--replace_result MEST MET
18
show variables like "system_time_zone";
19
20
#
21
# Test unix timestamp
22
#
23
select @a:=FROM_UNIXTIME(1);
24
select unix_timestamp(@a);
25
26
#
27
# Test of some values, including some with daylight saving time
28
#
29
30
CREATE TABLE t1 (ts int);
31
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
32
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
33
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 03:00'));
34
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
35
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
36
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
37
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 02:59:59'));
38
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 03:00:00'));
39
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 03:59:59'));
40
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
41
42
SELECT ts,from_unixtime(ts) FROM t1;
43
DROP TABLE t1;
44
45
46
#
47
# Test of warning for spring time-gap values for system time zone
48
#
49
CREATE TABLE t1 (ts timestamp);
50
INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'),
51
                           ('2003-03-30 03:00:00');
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
52
# Jay believes this is related to bug Drizzle bug #309403 - 
53
# returning wrong value for FROM_UNIXTIME
54
# see beginning of this file
55
#                           ('2003-03-30 02:59:59');
1 by brian
clean slate
56
DROP TABLE t1;
57
58
#
59
# Test for fix for Bug#2523 Check that boundary dates are processed
60
# correctly.
61
#
62
select unix_timestamp('1970-01-01 01:00:00'), 
63
       unix_timestamp('1970-01-01 01:00:01'),
64
       unix_timestamp('2038-01-19 04:14:07'),
65
       unix_timestamp('2038-01-19 04:14:08');
66
67
# End of 4.1 tests