Loading BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ dlenev@build.mysql.com dlenev@jabberwock.localdomain dlenev@mysql.com ejonore@mc03.ndb.mysql.com gbichot@production.mysql.com gbichot@quadita2.mysql.com gbichot@quadxeon.mysql.com georg@beethoven.local Loading client/mysqlbinlog.cc +1 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ #undef MYSQL_SERVER #include "client_priv.h" #include <my_time.h> #include "log_event.h" /* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */ #include "mysql_priv.h" #include "log_event.h" #define BIN_LOG_HEADER_SIZE 4 #define PROBE_HEADER_LEN (EVENT_LEN_OFFSET+4) Loading mysql-test/r/rpl_timezone.result +49 −16 Original line number Diff line number Diff line Loading @@ -4,21 +4,31 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; 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-01-01 03:00:00 2004-06-11 13:39:02 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'); Loading @@ -26,19 +36,35 @@ 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 show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query 1 # use `test`; create table t1 (t timestamp) master-bin.000001 # Query 1 # use `test`; create table t2 (t char(32)) master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT TIME_ZONE='UTC' master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902') master-bin.000001 # Query 1 # use `test`; delete from t1 master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902') /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 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; 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'); ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; set time_zone='MET'; insert into t2 (select t from t1); select * from t1; Loading @@ -52,10 +78,6 @@ t delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp), (current_date), (current_time); set timestamp=1000072000; select current_timestamp, current_date, current_time; current_timestamp current_date current_time 2001-09-10 01:46:40 2001-09-10 01:46:40 select * from t2; t 2001-09-09 23:46:40 Loading @@ -73,5 +95,16 @@ t 2001-09-09 03:46:40 1000000000 set global time_zone='MET'; ERROR HY000: Binary logging and replication forbid changing the global server time zone 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; mysql-test/t/rpl_timezone-slave.opt +1 −1 Original line number Diff line number Diff line --default-time-zone=Europe/Moscow --default-time-zone=Japan mysql-test/t/rpl_timezone.test +22 −12 Original line number Diff line number Diff line Loading @@ -3,21 +3,25 @@ source include/master-slave.inc; # Some preparations let $VERSION=`select version()`; set timestamp=100000000; # for fixed output of mysqlbinlog create table t1 (t timestamp); create table t2 (t char(32)); connection slave; select @@time_zone; # # Let us check how well replication works when we are saving datetime # value in TIMESTAMP field. # connection master; select @@time_zone; insert into t1 values ('20050101000000'), ('20050611093902'); set time_zone='UTC'; insert into t1 values ('20040101000000'), ('20040611093902'); select * from t1; # On slave we still in 'Europe/Moscow' so we should see equivalent but # textually different values. sync_slave_with_master; set time_zone='UTC'; select * from t1; # Let us check also that setting of time_zone back to default also works Loading @@ -28,12 +32,11 @@ set time_zone='Europe/Moscow'; insert into t1 values ('20040101000000'), ('20040611093902'); select * from t1; sync_slave_with_master; set time_zone='Europe/Moscow'; select * from t1; connection master; # We should not see SET ONE_SHOT time_zone before second insert --replace_result $VERSION VERSION --replace_column 2 # 5 # show binlog events; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 # # Now let us check how well we replicate statments reading TIMESTAMP fields Loading @@ -54,10 +57,6 @@ delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp), (current_date), (current_time); sync_slave_with_master; # Values in ouput of these to queries should differ because we are in # in 'MET' on master and in 'Europe/Moscow on slave... set timestamp=1000072000; select current_timestamp, current_date, current_time; select * from t2; # Loading @@ -73,13 +72,24 @@ sync_slave_with_master; select * from t2; # # Let us check that we are not allowing to set global time_zone with # Let us check that we are allowing to set global time_zone with # replication # connection master; --error 1387 set global time_zone='MET'; # # Let us see if CONVERT_TZ(@@time_zone) replicates # 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; sync_slave_with_master; select * from t2; # Clean up connection master; drop table t1, t2; sync_slave_with_master; Loading
BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ dlenev@build.mysql.com dlenev@jabberwock.localdomain dlenev@mysql.com ejonore@mc03.ndb.mysql.com gbichot@production.mysql.com gbichot@quadita2.mysql.com gbichot@quadxeon.mysql.com georg@beethoven.local Loading
client/mysqlbinlog.cc +1 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ #undef MYSQL_SERVER #include "client_priv.h" #include <my_time.h> #include "log_event.h" /* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */ #include "mysql_priv.h" #include "log_event.h" #define BIN_LOG_HEADER_SIZE 4 #define PROBE_HEADER_LEN (EVENT_LEN_OFFSET+4) Loading
mysql-test/r/rpl_timezone.result +49 −16 Original line number Diff line number Diff line Loading @@ -4,21 +4,31 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; 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-01-01 03:00:00 2004-06-11 13:39:02 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'); Loading @@ -26,19 +36,35 @@ 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 show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query 1 # use `test`; create table t1 (t timestamp) master-bin.000001 # Query 1 # use `test`; create table t2 (t char(32)) master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT TIME_ZONE='UTC' master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902') master-bin.000001 # Query 1 # use `test`; delete from t1 master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902') /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; 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; 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'); ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; set time_zone='MET'; insert into t2 (select t from t1); select * from t1; Loading @@ -52,10 +78,6 @@ t delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp), (current_date), (current_time); set timestamp=1000072000; select current_timestamp, current_date, current_time; current_timestamp current_date current_time 2001-09-10 01:46:40 2001-09-10 01:46:40 select * from t2; t 2001-09-09 23:46:40 Loading @@ -73,5 +95,16 @@ t 2001-09-09 03:46:40 1000000000 set global time_zone='MET'; ERROR HY000: Binary logging and replication forbid changing the global server time zone 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;
mysql-test/t/rpl_timezone-slave.opt +1 −1 Original line number Diff line number Diff line --default-time-zone=Europe/Moscow --default-time-zone=Japan
mysql-test/t/rpl_timezone.test +22 −12 Original line number Diff line number Diff line Loading @@ -3,21 +3,25 @@ source include/master-slave.inc; # Some preparations let $VERSION=`select version()`; set timestamp=100000000; # for fixed output of mysqlbinlog create table t1 (t timestamp); create table t2 (t char(32)); connection slave; select @@time_zone; # # Let us check how well replication works when we are saving datetime # value in TIMESTAMP field. # connection master; select @@time_zone; insert into t1 values ('20050101000000'), ('20050611093902'); set time_zone='UTC'; insert into t1 values ('20040101000000'), ('20040611093902'); select * from t1; # On slave we still in 'Europe/Moscow' so we should see equivalent but # textually different values. sync_slave_with_master; set time_zone='UTC'; select * from t1; # Let us check also that setting of time_zone back to default also works Loading @@ -28,12 +32,11 @@ set time_zone='Europe/Moscow'; insert into t1 values ('20040101000000'), ('20040611093902'); select * from t1; sync_slave_with_master; set time_zone='Europe/Moscow'; select * from t1; connection master; # We should not see SET ONE_SHOT time_zone before second insert --replace_result $VERSION VERSION --replace_column 2 # 5 # show binlog events; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 # # Now let us check how well we replicate statments reading TIMESTAMP fields Loading @@ -54,10 +57,6 @@ delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp), (current_date), (current_time); sync_slave_with_master; # Values in ouput of these to queries should differ because we are in # in 'MET' on master and in 'Europe/Moscow on slave... set timestamp=1000072000; select current_timestamp, current_date, current_time; select * from t2; # Loading @@ -73,13 +72,24 @@ sync_slave_with_master; select * from t2; # # Let us check that we are not allowing to set global time_zone with # Let us check that we are allowing to set global time_zone with # replication # connection master; --error 1387 set global time_zone='MET'; # # Let us see if CONVERT_TZ(@@time_zone) replicates # 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; sync_slave_with_master; select * from t2; # Clean up connection master; drop table t1, t2; sync_slave_with_master;