Commit 8a4c6521 authored by aelkin/andrei@mysql1000.(none)'s avatar aelkin/andrei@mysql1000.(none)
Browse files

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.
parent 122fefc5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
'\n##\n' starting by '>' ignore 1 lines;
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 t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+1 −0
Original line number Diff line number Diff line
@@ -53,3 +53,4 @@ Master_SSL_Cipher
Master_SSL_Key	
Seconds_Behind_Master	NULL
drop table t1;
drop table t1;
+11 −2
Original line number Diff line number Diff line
@@ -147,12 +147,20 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
wait_for_slave_to_stop;
drop table t2;

# cleanup:

set @@global.sql_slave_skip_counter=1;
start slave;

connection master;
drop table t2;
drop table t1;

sync_slave_with_master;

# 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;

--error 1062
@@ -160,5 +168,6 @@ LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;

DROP TABLE t1;

sync_with_master;
sync_slave_with_master;

# End of 4.1 tests
+3 −2
Original line number Diff line number Diff line
@@ -15,12 +15,13 @@ select * from t1;

connection master;
drop table t1;
sync_with_master;
sync_slave_with_master;
# End of 4.1 tests

#
# #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
#
connection master;
create table t1(a int primary key);
insert into t1 values (1),(2);
delete from t1 where @@server_id=1;
@@ -36,5 +37,5 @@ select * from t1;
show slave status;
connection master;
drop table t1;
sync_with_master;
sync_slave_with_master;
# End of 5.0 tests
+5 −1
Original line number Diff line number Diff line
@@ -29,8 +29,12 @@ start slave;
--vertical_results
show slave status;

# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually

connection master;
drop table t1;
sync_with_master;
connection slave;
drop table t1;

# end of 4.1 tests
Loading