~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/timezone.test

  • Committer: Monty Taylor
  • Date: 2008-11-16 05:36:13 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116053613-bld4rqxhlkb49c02
Split out cache_row and type_holder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Test of SYSTEM time zone handling ( for my_system_gmt_sec()).
3
 
# This script must be run with TZ=MET
4
 
 
5
 
#-- require r/have_met_timezone.require
6
 
disable_query_log;
7
 
# Drizzle bug #309403 - returning wrong value for FROM_UNIXTIME
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');
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');
52
 
DROP TABLE t1;
53
 
 
54
 
#
55
 
# Test for fix for Bug#2523 Check that boundary dates are processed
56
 
# correctly.
57
 
# -- scratch the above, Drizzle allows for longer dates.
58
 
#
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');
62
 
--error ER_INVALID_UNIX_TIMESTAMP_VALUE # Bad timestamp
63
 
select unix_timestamp('2038-01-19 03:14:08');
64
 
 
65
 
# End of 4.1 tests