~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
#
17
# Test unix timestamp
18
#
19
select @a:=FROM_UNIXTIME(1);
20
select unix_timestamp(@a);
21
22
#
23
# Test of some values, including some with daylight saving time
24
#
25
26
CREATE TABLE t1 (ts int);
27
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00'));
28
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
29
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 03:00'));
30
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00'));
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('2003-03-30 02:59:59'));
34
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 03:00:00'));
35
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 03:59:59'));
36
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
37
38
SELECT ts,from_unixtime(ts) FROM t1;
39
DROP TABLE t1;
40
41
42
#
43
# Test of warning for spring time-gap values for system time zone
44
#
45
CREATE TABLE t1 (ts timestamp);
46
INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'),
47
                           ('2003-03-30 03:00:00');
642.1.41 by Lee
enable warnings test and fix timezone test to comment out the failing test
48
# Jay believes this is related to bug Drizzle bug #309403 - 
49
# returning wrong value for FROM_UNIXTIME
50
# see beginning of this file
51
#                           ('2003-03-30 02:59:59');
1 by brian
clean slate
52
DROP TABLE t1;
53
54
#
55
# Test for fix for Bug#2523 Check that boundary dates are processed
56
# correctly.
2082.4.1 by Brian Aker
Merge in trunk.
57
# -- scratch the above, Drizzle allows for longer dates.
1 by brian
clean slate
58
#
907.1.7 by Jay Pipes
Merged in remove-timezone work
59
select unix_timestamp('1970-01-01 00:00:00');
60
select unix_timestamp('1970-01-01 00:00:01');
61
select unix_timestamp('2038-01-19 03:14:07');
2097.1.6 by Brian Aker
Place limits on timestamp (unforunatly)
62
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
907.1.7 by Jay Pipes
Merged in remove-timezone work
63
select unix_timestamp('2038-01-19 03:14:08');
1 by brian
clean slate
64
65
# End of 4.1 tests