Commit 0e679ab7 authored by unknown's avatar unknown

Bug #26622 MASTER_POS_WAIT does not work as documented

Affected tests fixing. After the fix for st_relay_log_info::wait_for_pos() that
handles widely used select('master-bin.xxxx',pos) invoked by mysqltest
there appeared to be four tests that either tried synchronizing when
the slave was stopped or used incorrect synchronization method like
to call `sync_with_master' from the current connection being to the
master itself.

Fixed with correcting the current connection or/and using the correct
synchronization macro when possible.


mysql-test/r/rpl_loaddata.result:
  results changed
mysql-test/r/rpl_slave_status.result:
  results changed
mysql-test/t/rpl_loaddata.test:
  fixing cleanup for two tests
mysql-test/t/rpl_skip_error.test:
  fixing cleanup for two tests
mysql-test/t/rpl_slave_status.test:
  fixing cleanup
mysql-test/t/rpl_temporary.test:
  fixing synchronizations to use the intended correct macro.
parent 04c5af18
...@@ -77,7 +77,8 @@ load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields ...@@ -77,7 +77,8 @@ load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 1 ERROR 23000: Duplicate entry '2003-03-22' for key 1
drop table t2; set @@global.sql_slave_skip_counter=1;
start slave;
drop table t2; drop table t2;
drop table t1; drop table t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
......
...@@ -53,3 +53,4 @@ Master_SSL_Cipher ...@@ -53,3 +53,4 @@ Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master NULL Seconds_Behind_Master NULL
drop table t1; drop table t1;
drop table t1;
...@@ -147,12 +147,20 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by ...@@ -147,12 +147,20 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
connection slave; connection slave;
wait_for_slave_to_stop; wait_for_slave_to_stop;
drop table t2;
# cleanup:
set @@global.sql_slave_skip_counter=1;
start slave;
connection master; connection master;
drop table t2; drop table t2;
drop table t1; drop table t1;
sync_slave_with_master;
# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed # BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
connection master;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error 1062 --error 1062
...@@ -160,5 +168,6 @@ LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1; ...@@ -160,5 +168,6 @@ LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
DROP TABLE t1; DROP TABLE t1;
sync_with_master; sync_slave_with_master;
# End of 4.1 tests # End of 4.1 tests
...@@ -15,12 +15,13 @@ select * from t1; ...@@ -15,12 +15,13 @@ select * from t1;
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; sync_slave_with_master;
# End of 4.1 tests # End of 4.1 tests
# #
# #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists # #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
# #
connection master;
create table t1(a int primary key); create table t1(a int primary key);
insert into t1 values (1),(2); insert into t1 values (1),(2);
delete from t1 where @@server_id=1; delete from t1 where @@server_id=1;
...@@ -36,5 +37,5 @@ select * from t1; ...@@ -36,5 +37,5 @@ select * from t1;
show slave status; show slave status;
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; sync_slave_with_master;
# End of 5.0 tests # End of 5.0 tests
...@@ -29,8 +29,12 @@ start slave; ...@@ -29,8 +29,12 @@ start slave;
--vertical_results --vertical_results
show slave status; show slave status;
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; connection slave;
drop table t1;
# end of 4.1 tests # end of 4.1 tests
...@@ -130,7 +130,7 @@ drop table t1,t2; ...@@ -130,7 +130,7 @@ drop table t1,t2;
# don't get any memory leaks for this # don't get any memory leaks for this
create temporary table t3 (f int); create temporary table t3 (f int);
sync_with_master; sync_slave_with_master;
# The server will now close done # The server will now close done
...@@ -141,7 +141,8 @@ sync_with_master; ...@@ -141,7 +141,8 @@ sync_with_master;
connection master; connection master;
create temporary table t4 (f int); create temporary table t4 (f int);
create table t5 (f int); create table t5 (f int);
sync_with_master; sync_slave_with_master;
connection master;
# find dumper's $id # find dumper's $id
source include/get_binlog_dump_thread_id.inc; source include/get_binlog_dump_thread_id.inc;
insert into t4 values (1); insert into t4 values (1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment