mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
d40f7056ae
mysql-test/include/have_outfile.inc: Use MYSQLTEST_VARDIR mysql-test/include/test_outfile.inc: Use MYSQLTEST_VARDIR mysql-test/mysql-test-run.pl: Create variable $MYSQLTEST_VARDIR that points to the vardir Don't create a symlink from var/ to the physical vardir if it's somewhere else Setup a symlink(or copy dir on windows) for std_data so it is available in the physical vardir Use "../tmp" as slave-load-tmpdir, since the server is started in var/master-data and slave in var/slave-data they will both find the dumps in "../tmp" mysql-test/mysql-test-run.sh: Export MYSQLTEST_VARDIR, always pointing at mysql-test/var mysql-test/r/backup.result: Use MYSQLTEST_VARDIR mysql-test/r/blackhole.result: Use "../std_data_ln" to find std_data files mysql-test/r/loaddata.result: Use "../std_data_ln" to find std_data files mysql-test/r/mysqlbinlog.result: Use "../std_data_ln" to find std_data files mysql-test/r/mysqltest.result: Use MYSQLTEST_VARDIR mysql-test/r/outfile.result: Use MYSQLTEST_VARDIR mysql-test/r/query_cache.result: Add missing drop function mysql-test/r/rpl000001.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl000004.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_innodb.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddata.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddata_rule_m.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddata_rule_s.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddatalocal.result: Use MYSQLTEST_VARDIR mysql-test/r/rpl_log.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_misc_functions.result: Use MYSQLTEST_VARDIR mysql-test/r/rpl_replicate_do.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_rewrite_db.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_timezone.result: Use "../std_data_ln" to find std_data files mysql-test/r/symlink.result: Use MYSQLTEST_VARDIR mysql-test/r/trigger.result: Use "../std_data_ln" to find std_data files mysql-test/r/view.result: Use "../std_data_ln" to find std_data files mysql-test/r/warnings.result: Use "../std_data_ln" to find std_data files mysql-test/t/backup-master.sh: Use MYSQLTEST_VARDIR mysql-test/t/backup.test: Use MYSQLTEST_VARDIR mysql-test/t/blackhole.test: Use "../std_data_ln" to find std_data files mysql-test/t/ctype_ucs_binlog.test: Use MYSQLTEST_VARDIR mysql-test/t/im_daemon_life_cycle-im.opt: Use MYSQLTEST_VARDIR mysql-test/t/im_options_set.imtest: Use MYSQLTEST_VARDIR mysql-test/t/im_options_unset.imtest: Use MYSQLTEST_VARDIR mysql-test/t/loaddata.test: Use "../std_data_ln" to find std_data files mysql-test/t/myisam.test: Use MYSQLTEST_VARDIR mysql-test/t/mysqlbinlog.test: Use "../std_data_ln" to find std_data files mysql-test/t/mysqlbinlog2.test: Use MYSQLTEST_VARDIR mysql-test/t/mysqldump.test: Use MYSQLTEST_VARDIR mysql-test/t/mysqltest.test: Use MYSQLTEST_VARDIR mysql-test/t/ndb_autodiscover.test: Use MYSQLTEST_VARDIR mysql-test/t/outfile.test: Use MYSQLTEST_VARDIR mysql-test/t/query_cache.test: Add missing drop function mysql-test/t/repair.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl000001.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl000004.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl000009.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl000015-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl000017-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_EE_error.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_charset.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_drop_db.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-master.opt: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-master.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-slave.opt: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_innodb.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddata.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddata_rule_m.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddata_rule_s.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddatalocal.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_log.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_misc_functions-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_misc_functions.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_replicate_do.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_rewrite_db.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_rotate_logs-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_rotate_logs.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_timezone.test: Use MYSQLTEST_VARDIR mysql-test/t/show_check.test: Use MYSQLTEST_VARDIR mysql-test/t/sp-destruct.test: Use MYSQLTEST_VARDIR mysql-test/t/symlink.test: Use MYSQLTEST_VARDIR mysql-test/t/temp_table-master.opt: Use MYSQLTEST_VARDIR mysql-test/t/trigger-compat.test: Use MYSQLTEST_VARDIR mysql-test/t/trigger-grant.test: Use MYSQLTEST_VARDIR mysql-test/t/trigger.test: Use "../std_data_ln" to find std_data files mysql-test/t/type_varchar.test: Use MYSQLTEST_VARDIR mysql-test/t/user_var-binlog.test: Use MYSQLTEST_VARDIR mysql-test/t/view.test: Use "../std_data_ln" to find std_data files mysql-test/t/warnings.test: Use "../std_data_ln" to find std_data files mysql-test/include/sourced.inc: New BitKeeper file ``mysql-test/include/sourced.inc'' mysql-test/include/sourced1.inc: New BitKeeper file ``mysql-test/include/sourced1.inc''
126 lines
3.4 KiB
Text
126 lines
3.4 KiB
Text
# Test of replication of time zones.
|
|
|
|
# There is currently some bug possibly in prepared statements (this
|
|
# test fails with --ps-protocol): sys_var_thd_time_zone::value_ptr()
|
|
# is called only at prepare time, not at execution time. So,
|
|
# thd->time_zone_used is not equal to 1 (it is back to 0, because of
|
|
# reset_thd_for_next_command called at execution time), so the
|
|
# timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem
|
|
# and possibly Konstantin).
|
|
|
|
--disable_ps_protocol
|
|
|
|
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;
|
|
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
|
|
# well
|
|
connection master;
|
|
delete from t1;
|
|
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;
|
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
|
|
|
|
# Let us check with LOAD DATA INFILE
|
|
# (we do it after mysqlbinlog because the temp files names are not constant)
|
|
connection master;
|
|
delete from t1;
|
|
set time_zone='UTC';
|
|
load data infile '../std_data_ln/rpl_timezone.dat' into table t1;
|
|
select * from t1;
|
|
sync_slave_with_master;
|
|
set time_zone='UTC';
|
|
select * from t1;
|
|
set time_zone='Europe/Moscow';
|
|
|
|
# Put back values of before the LOAD
|
|
connection master;
|
|
set time_zone='Europe/Moscow';
|
|
delete from t1;
|
|
insert into t1 values ('20040101000000'), ('20040611093902');
|
|
|
|
#
|
|
# Now let us check how well we replicate statments reading TIMESTAMP fields
|
|
# (We should see the same data on master and on slave but it should differ
|
|
# from originally inserted)
|
|
#
|
|
set time_zone='MET';
|
|
insert into t2 (select t from t1);
|
|
select * from t1;
|
|
sync_slave_with_master;
|
|
select * from t2;
|
|
|
|
#
|
|
# Now let us check how well we replicate various CURRENT_* functions
|
|
#
|
|
connection master;
|
|
delete from t2;
|
|
set timestamp=1000072000;
|
|
insert into t2 values (current_timestamp), (current_date), (current_time);
|
|
sync_slave_with_master;
|
|
select * from t2;
|
|
|
|
#
|
|
# At last let us check replication of FROM_UNIXTIME/UNIX_TIMESTAMP functions.
|
|
#
|
|
connection master;
|
|
delete from t2;
|
|
insert into t2 values (from_unixtime(1000000000)),
|
|
(unix_timestamp('2001-09-09 03:46:40'));
|
|
select * from t2;
|
|
sync_slave_with_master;
|
|
# We should get same result on slave as on master
|
|
select * from t2;
|
|
|
|
#
|
|
# Let us check that we are allowing to set global time_zone with
|
|
# replication
|
|
#
|
|
connection master;
|
|
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;
|
|
|
|
# End of 4.1 tests
|