~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_timezone.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
set @my_time_zone= @@global.time_zone;
 
8
set timestamp=100000000;
 
9
create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
 
10
create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
 
11
select @@time_zone;
 
12
@@time_zone
 
13
Japan
 
14
select @@time_zone;
 
15
@@time_zone
 
16
Europe/Moscow
 
17
insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
 
18
insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
 
19
SELECT * FROM t1 ORDER BY n;
 
20
t       n
 
21
2005-01-01 00:00:00     1
 
22
2005-06-11 09:39:02     2
 
23
2004-01-01 00:00:00     3
 
24
2004-06-11 09:39:02     4
 
25
SELECT * FROM t1 ORDER BY n;
 
26
t       n
 
27
2005-01-01 06:00:00     1
 
28
2005-06-11 14:39:02     2
 
29
2004-01-01 06:00:00     3
 
30
2004-06-11 14:39:02     4
 
31
delete from t1;
 
32
set time_zone='Europe/Moscow';
 
33
insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
 
34
SELECT * FROM t1 ORDER BY n;
 
35
t       n
 
36
2004-01-01 00:00:00     5
 
37
2004-06-11 09:39:02     6
 
38
set time_zone='Europe/Moscow';
 
39
SELECT * FROM t1 ORDER BY n;
 
40
t       n
 
41
2004-01-01 00:00:00     5
 
42
2004-06-11 09:39:02     6
 
43
delete from t1;
 
44
set time_zone='UTC';
 
45
load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
 
46
Warnings:
 
47
Warning 1265    Data truncated for column 't' at row 1
 
48
Warning 1261    Row 1 doesn't contain data for all columns
 
49
Warning 1265    Data truncated for column 't' at row 2
 
50
Warning 1261    Row 2 doesn't contain data for all columns
 
51
SELECT * FROM t1 ORDER BY n;
 
52
t       n
 
53
0000-00-00 00:00:00     7
 
54
0000-00-00 00:00:00     8
 
55
set time_zone='UTC';
 
56
SELECT * FROM t1 ORDER BY n;
 
57
t       n
 
58
0000-00-00 00:00:00     7
 
59
0000-00-00 00:00:00     8
 
60
set time_zone='Europe/Moscow';
 
61
set time_zone='Europe/Moscow';
 
62
delete from t1;
 
63
insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
 
64
set time_zone='MET';
 
65
insert into t2 (select * from t1);
 
66
SELECT * FROM t1 ORDER BY n;
 
67
t       n
 
68
2003-12-31 22:00:00     9
 
69
2004-06-11 07:39:02     10
 
70
SELECT * FROM t2 ORDER BY n;
 
71
t       n
 
72
2003-12-31 22:00:00     9
 
73
2004-06-11 07:39:02     10
 
74
delete from t2;
 
75
set timestamp=1000072000;
 
76
insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
 
77
SELECT * FROM t2 ORDER BY n;
 
78
t       n
 
79
2001-09-09 23:46:40     11
 
80
2001-09-09      12
 
81
23:46:40        13
 
82
delete from t2;
 
83
insert into t2 values (from_unixtime(1000000000),NULL),
 
84
(unix_timestamp('2001-09-09 03:46:40'),NULL);
 
85
SELECT * FROM t2 ORDER BY n;
 
86
t       n
 
87
2001-09-09 03:46:40     14
 
88
1000000000      15
 
89
SELECT * FROM t2 ORDER BY n;
 
90
t       n
 
91
2001-09-09 03:46:40     14
 
92
1000000000      15
 
93
set global time_zone='MET';
 
94
delete from t2;
 
95
set time_zone='UTC';
 
96
insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
 
97
insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
 
98
SELECT * FROM t2 ORDER BY n;
 
99
t       n
 
100
2003-12-31 23:00:00     16
 
101
2005-01-01 08:00:00     17
 
102
SELECT * FROM t2 ORDER BY n;
 
103
t       n
 
104
2003-12-31 23:00:00     16
 
105
2005-01-01 08:00:00     17
 
106
drop table t1, t2;
 
107
set global time_zone= @my_time_zone;
 
108
End of 4.1 tests
 
109
CREATE TABLE t1 (a INT, b TIMESTAMP);
 
110
INSERT INTO t1 VALUES (1, NOW());
 
111
SET @@session.time_zone='Japan';
 
112
UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1;
 
113
Warnings:
 
114
Warning 1264    Out of range value for column 'b' at row 1
 
115
SELECT * FROM t1 ORDER BY a;
 
116
a       b
 
117
1       0000-00-00 00:00:00
 
118
SET @@session.time_zone='Japan';
 
119
SELECT * FROM t1 ORDER BY a;
 
120
a       b
 
121
1       0000-00-00 00:00:00
 
122
SET @@session.time_zone = default;
 
123
DROP TABLE t1;
 
124
SET @@session.time_zone = default;
 
125
End of 5.0 tests