stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set @my_time_zone= @@global.time_zone;
set timestamp=100000000;
create table t1 (t timestamp);
create table t2 (t char(32));
select @@time_zone;
@@time_zone
Japan
select @@time_zone;
@@time_zone
Europe/Moscow
insert into t1 values ('20050101000000'), ('20050611093902');
set time_zone='UTC';
insert into t1 values ('20040101000000'), ('20040611093902');
select * from t1;
t
2004-12-31 21:00:00
2005-06-11 05:39:02
2004-01-01 00:00:00
2004-06-11 09:39:02
set time_zone='UTC';
select * from t1;
t
2004-12-31 21:00:00
2005-06-11 05:39:02
2004-01-01 00:00:00
2004-06-11 09:39:02
delete from t1;
set time_zone='Europe/Moscow';
insert into t1 values ('20040101000000'), ('20040611093902');
select * from t1;
t
2004-01-01 00:00:00
2004-06-11 09:39:02
set time_zone='Europe/Moscow';
select * from t1;
t
2004-01-01 00:00:00
2004-06-11 09:39:02
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=100000000/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
create table t1 (t timestamp)
/*!*/;
SET TIMESTAMP=100000000/*!*/;
create table t2 (t char(32))
/*!*/;
SET TIMESTAMP=100000000/*!*/;
SET @@session.time_zone='Europe/Moscow'/*!*/;
insert into t1 values ('20050101000000'), ('20050611093902')
/*!*/;
SET TIMESTAMP=100000000/*!*/;
SET @@session.time_zone='UTC'/*!*/;
insert into t1 values ('20040101000000'), ('20040611093902')
/*!*/;
SET TIMESTAMP=100000000/*!*/;
delete from t1
/*!*/;
SET TIMESTAMP=100000000/*!*/;
SET @@session.time_zone='Europe/Moscow'/*!*/;
insert into t1 values ('20040101000000'), ('20040611093902')
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
delete from t1;
set time_zone='UTC';
load data infile '../std_data_ln/rpl_timezone.dat' into table t1;
select * from t1;
t
2004-01-01 00:00:00
2004-06-11 09:39:02
set time_zone='UTC';
select * from t1;
t
2004-01-01 00:00:00
2004-06-11 09:39:02
set time_zone='Europe/Moscow';
set time_zone='Europe/Moscow';
delete from t1;
insert into t1 values ('20040101000000'), ('20040611093902');
set time_zone='MET';
insert into t2 (select t from t1);
select * from t1;
t
2003-12-31 22:00:00
2004-06-11 07:39:02
select * from t2;
t
2003-12-31 22:00:00
2004-06-11 07:39:02
delete from t2;
set timestamp=1000072000;
insert into t2 values (current_timestamp), (current_date), (current_time);
select * from t2;
t
2001-09-09 23:46:40
2001-09-09
23:46:40
delete from t2;
insert into t2 values (from_unixtime(1000000000)),
(unix_timestamp('2001-09-09 03:46:40'));
select * from t2;
t
2001-09-09 03:46:40
1000000000
select * from t2;
t
2001-09-09 03:46:40
1000000000
set global time_zone='MET';
delete from t2;
set time_zone='UTC';
insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone));
insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'));
select * from t2;
t
2003-12-31 23:00:00
2005-01-01 08:00:00
select * from t2;
t
2003-12-31 23:00:00
2005-01-01 08:00:00
drop table t1, t2;
set global time_zone= @my_time_zone;
End of 4.1 tests
CREATE TABLE t1 (a INT, b TIMESTAMP);
INSERT INTO t1 VALUES (1, NOW());
SET @@session.time_zone='Japan';
UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1;
Warnings:
Warning	1264	Out of range value adjusted for column 'b' at row 1
SELECT * FROM t1 ORDER BY a;
a	b
1	0000-00-00 00:00:00
SET @@session.time_zone='Japan';
SELECT * FROM t1 ORDER BY a;
a	b
1	0000-00-00 00:00:00
SET @@session.time_zone = default;
DROP TABLE t1;
SET @@session.time_zone = default;
reset master;
CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
SET @@session.time_zone='+01:00';
insert into t1 values('2008-12-23 19:39:39',1);
SET @@session.time_zone='+02:00';
insert delayed into t1 values ('2008-12-23 19:39:39',2);
flush table t1;
flush logs;
select * from t1;
date	a
2008-12-23 20:39:39	1
2008-12-23 19:39:39	2
DROP TABLE t1;
select * from t1 order by a;
date	a
2008-12-23 20:39:39	1
2008-12-23 19:39:39	2
DROP TABLE t1;
SET @@session.time_zone = default;
End of 5.0 tests
