summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_stm_until.test
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-12-16 21:02:21 +0300
committerAlexander Nozdrin <alik@sun.com>2009-12-16 21:02:21 +0300
commit5f0c09dd7220b7ad5709823788e9289fc94ab8fe (patch)
treec656767fe54a976ffb669926348b9fac198be312 /mysql-test/suite/rpl/t/rpl_stm_until.test
parent5194074be762f169fcc25b9ad0d4013905ba0655 (diff)
parentf1e83a4163458f7e25c709403cc7c7b48a7ef23e (diff)
downloadmariadb-git-5f0c09dd7220b7ad5709823788e9289fc94ab8fe.tar.gz
Manual merge from mysql-trunk-merge.
Conflicts: - include/my_no_pthread.h - mysql-test/r/sp-ucs2.result - sql/log.cc - sql/sql_acl.cc - sql/sql_yacc.yy
Diffstat (limited to 'mysql-test/suite/rpl/t/rpl_stm_until.test')
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test64
1 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 6b731780163..33fb22d00c3 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -101,3 +101,67 @@ start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=776;
+#
+# bug#47210 first execution of "start slave until" stops too early
+#
+# testing that a slave rotate event that is caused by stopping the slave
+# does not intervene anymore in UNTIL condition.
+#
+
+connection slave;
+source include/stop_slave.inc;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+reset slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+
+connection master;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+reset master;
+create table t1 (a int primary key auto_increment);
+save_master_pos;
+let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+start slave;
+sync_with_master;
+
+# at this point slave will close the relay log stamping it with its own
+# Rotate log event. This event won't be examined on matter of the master
+# UNTIL pos anymore.
+source include/stop_slave.inc;
+let $slave_exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+
+--echo master and slave are in sync now
+let $diff_pos= `select $master_pos - $slave_exec_pos`;
+eval select $diff_pos as zero;
+
+connection master;
+insert into t1 set a=null;
+let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+insert into t1 set a=null;
+select count(*) as two from t1;
+
+connection slave;
+--replace_result $until_pos UNTIL_POS;
+eval start slave until master_log_file='master-bin.000001', master_log_pos= $until_pos;
+source include/wait_for_slave_sql_to_stop.inc;
+let $slave_exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--echo slave stopped at the prescribed position
+let $diff_pos= `select $until_pos - $slave_exec_pos`;
+eval select $diff_pos as zero;
+select count(*) as one from t1;
+
+
+connection master;
+drop table t1;
+
+connection slave;
+start slave;
+sync_with_master;
+
+# End of tests