summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2009-02-09 23:51:59 +0100
committerMats Kindahl <mats@sun.com>2009-02-09 23:51:59 +0100
commit8a98664d3b825f7d98d7acd8372079fc6224dfcb (patch)
tree82b5d2468e08a43e31587af5f72ab6d52e5aff5c /mysql-test/extra
parentbd53d21417e2d340758abfeb29f7057221e0da03 (diff)
parent86a11e6a39593db66b56013841adb5059c8d1455 (diff)
downloadmariadb-git-8a98664d3b825f7d98d7acd8372079fc6224dfcb.tar.gz
Merging with 5.1-bugteam.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/binlog_tests/blackhole.test4
-rw-r--r--mysql-test/extra/binlog_tests/ctype_ucs_binlog.test3
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test7
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_EE_err.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_conflicts.test168
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_flsh_tbls.test19
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test23
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test41
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_001.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp002.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test9
16 files changed, 249 insertions, 69 deletions
diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test
index e8671ed2da0..14c15a58e18 100644
--- a/mysql-test/extra/binlog_tests/blackhole.test
+++ b/mysql-test/extra/binlog_tests/blackhole.test
@@ -7,7 +7,7 @@
-- source include/have_log_bin.inc
# The server need to be started in $MYSQLTEST_VARDIR since it
-# uses ../std_data_ln/
+# uses ../../std_data/
-- source include/uses_vardir.inc
--disable_warnings
@@ -114,7 +114,7 @@ insert into t1 values(1);
insert ignore into t1 values(1);
replace into t1 values(100);
create table t2 (a varchar(200)) engine=blackhole;
-eval load data infile '../std_data_ln/words.dat' into table t2;
+eval load data infile '../../std_data/words.dat' into table t2;
alter table t1 add b int;
alter table t1 drop b;
create table t3 like t1;
diff --git a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
index fa374502997..b240109f6e6 100644
--- a/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
@@ -16,7 +16,8 @@ source include/show_binlog_events.inc;
# escaped).
flush logs;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
drop table t2;
# End of 4.1 tests
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
index 6879089a1b7..5db79e4f848 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -317,17 +317,18 @@ connection con4;
select get_lock("a",10); # wait for rollback to finish
flush logs;
+let $MYSQLD_DATADIR= `select @@datadir`;
# we check that the error code of the "ROLLBACK" event is 0 and not
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
# and does not make slave to stop)
if (`select @@binlog_format = 'ROW'`)
{
- --exec $MYSQL_BINLOG --start-position=524 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+ --exec $MYSQL_BINLOG --start-position=524 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
- --exec $MYSQL_BINLOG --start-position=555 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
+ --exec $MYSQL_BINLOG --start-position=555 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -618,7 +619,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# execute
--error ER_DUP_ENTRY
- load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+ load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
# check
select * from t4;
select count(*) from t1 /* must be 2 */;
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
index 0a0bef4ca4d..26a70c4319e 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
@@ -278,7 +278,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# execute
--error ER_DUP_ENTRY
- load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
+ load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
# check
select * from t4;
select count(*) from t1 /* must be 2 */;
diff --git a/mysql-test/extra/rpl_tests/rpl_EE_err.test b/mysql-test/extra/rpl_tests/rpl_EE_err.test
index b7b393c3d6f..205bbe79dac 100644
--- a/mysql-test/extra/rpl_tests/rpl_EE_err.test
+++ b/mysql-test/extra/rpl_tests/rpl_EE_err.test
@@ -20,7 +20,8 @@
eval create table t1 (a int) engine=$engine_type;
flush tables;
-remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1;
save_master_pos;
connection slave;
diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test
new file mode 100644
index 00000000000..8a98059b0ad
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test
@@ -0,0 +1,168 @@
+# ==== Purpose ====
+#
+# Test that slave behaves well in some conflict situations. The
+# following are tested:
+#
+# - The slave SQL thread sees an 'INSERT' of a row with a key that
+# already exists in the table;
+#
+# - The slave SQL thread sees a 'DELETE' of a row that does not
+# exist in the table.
+#
+# In statement-logging mode, the first conflict type causes the slave
+# to stop with an error and the second conflict is ignored.
+#
+# In row-logging mode, the slave behavior depends the value of
+# @@slave_exec_mode on the slave: if @@slave_exec_mode is IDEMPOTENT,
+# the slave should ignore the conflicting statement and continue
+# normally. If @@slave_exec_mode is STRICT, the slave should stop
+# with an error.
+#
+# This test was previously named rpl_stm_mystery22/rpl_row_mystery22.
+#
+#
+# ==== Method ====
+#
+# Create a table on master and slave, insert a row on slave, and
+# insert the same row on master.
+#
+# Create a table on master and slave, insert a row on master with
+# binlogging turned off, and remove the row on master with binlogging
+# turned on.
+#
+#
+# ==== Related bugs ====
+#
+# BUG#31552: Replication breaks when deleting rows from out-of-sync table without PK
+# BUG#31609: Not all RBR slave errors reported as errors
+#
+# Bug in this test case:
+# BUG#37718: rpl.rpl_stm_mystery22 fails sporadically on pushbuild
+#
+#
+# ==== Usage ====
+#
+# This file assumes the following:
+#
+# - The test language variable $slave_is_idempotent is set to 1 if the
+# slave is expected to stop on duplicate key errors (i.e., if the
+# binlog is in statement mode or
+# @@global.slave_exec_mode=STRICT). It is set to 0 otherwise.
+#
+# - Replication has been initialized by include/master-slave.inc
+#
+# - The test adds a suppression for the following warning:
+# Slave: Can't find record in 't1' Error_code: 1032
+
+
+--echo ==== Initialize ====
+
+--echo [on master]
+connection master;
+CREATE TABLE t1(a INT PRIMARY KEY);
+--echo [on slave]
+sync_slave_with_master;
+
+
+--echo ==== Test: SQL thread sees 'INSERT' of existing key ====
+
+--echo ---- Prepare slave so that it will get duplicate key error ----
+# This row will be in the way of the row inserted by master.
+INSERT INTO t1 VALUES (1);
+
+--echo ---- Insert rows on master ----
+--echo [on master]
+connection master;
+# Insert the same row on master
+INSERT INTO t1 VALUES (1);
+save_master_pos;
+SELECT * FROM t1;
+
+--echo [on slave]
+connection slave;
+
+# If we are statement-logging or if slave_exec_mode=STRICT, we now
+# expect to see an error on the slave. Otherwise (i.e., we are
+# row-logging and slave_exec_mode=IDEMPOTENT), we expect that the
+# duplicate row is ignored by the slave and replication continues.
+if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRICT'`) {
+ --echo ---- Wait until slave stops with an error ----
+ # Wait until the slave tries to run the query, fails with duplicate
+ # key error, and stops the SQL thread.
+ let $slave_sql_errno= 1062; # ER_DUP_ENTRY
+ source include/wait_for_slave_sql_error.inc;
+ let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+ --echo Last_SQL_Error = $err (expected "duplicate key" error)
+ SELECT * FROM t1;
+
+ --echo ---- Resolve the conflict on the slave and restart SQL thread ----
+ DELETE FROM t1 WHERE a = 1;
+ START SLAVE SQL_THREAD;
+ source include/wait_for_slave_sql_to_start.inc;
+}
+
+--echo ---- Sync slave and verify that there is no error ----
+sync_with_master;
+let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+--echo Last_SQL_Error = '$err' (expected no error)
+SELECT * FROM t1;
+
+
+--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
+
+--echo ---- On master, insert two rows, the second with binlogging off ----
+--echo [on master]
+connection master;
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+
+--echo [on slave]
+sync_slave_with_master;
+DELETE FROM t1 WHERE a = 1;
+
+--echo ---- On master, remove the row that does not exist on slave ----
+--echo [on master]
+connection master;
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+save_master_pos;
+
+--echo [on slave]
+connection slave;
+
+# If we are row-logging and slave_exec_mode is STRICT, we now expect
+# an error since the row to delete does not exist on slave. Otherwise
+# (i.e., either we are statement-logging or slave_exec_mode is
+# IDEMPOTENT), the absence of the row to delete is ignored and
+# replication continues.
+if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) {
+ --echo ---- Wait until slave stops with an error ----
+ let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
+ source include/wait_for_slave_sql_error.inc;
+ let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+ --echo Last_SQL_Error = $err (expected "can't find record" error)
+ SELECT * FROM t1;
+
+ --echo ---- Resolve the conflict on the slave and restart SQL thread ----
+ INSERT INTO t1 VALUES (1);
+ START SLAVE SQL_THREAD;
+ source include/wait_for_slave_sql_to_start.inc;
+}
+
+--echo ---- Sync slave and verify that there is no error ----
+# The slave should sync ok, and SHOW SLAVE STATUS should give no
+# error.
+sync_with_master;
+let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+--echo Last_SQL_Error = $err (expected no error)
+SELECT * FROM t1;
+
+
+--echo ==== Clean up ====
+
+--echo [on master]
+connection master;
+DROP TABLE t1;
+
+--echo [on slave]
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
index 5abd04b98ef..c426ac1fae8 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
@@ -419,7 +419,7 @@ connection master;
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
- update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+ update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
--echo
--echo ** Delete from Master **
@@ -497,7 +497,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
--echo ********************************************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -554,7 +554,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
--echo ********************************************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -697,7 +697,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
# Remove below once fixed
#***************************
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -763,7 +763,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
--echo ********************************************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -840,7 +840,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo *****************
--echo
connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
index 7e726828a1e..6890913b7d1 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -94,7 +94,7 @@ SELECT * FROM t2 ORDER BY a;
--echo *** Start Slave ***
connection slave;
START SLAVE;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
@@ -429,6 +429,7 @@ set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
index ee6b0ed1426..0baf49c9fac 100644
--- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
+++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
@@ -4,8 +4,7 @@
# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
#
-
--- source include/master-slave.inc
+source include/master-slave.inc;
let $SERVER_VERSION=`select version()`;
@@ -34,26 +33,32 @@ flush tables;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
-save_master_pos;
-connection slave;
-sync_with_master;
+
+sync_slave_with_master;
# Check that the slave is not confused.
select * from t3;
# Note that all this confusion may cause warnings 'table xx is open on rename'
# in the .err files; these are not fatal and are not reported by mysql-test-run.
-
stop slave;
+source include/wait_for_slave_to_stop.inc;
+
connection master;
drop table t1;
+
connection slave;
flush tables with read lock;
start slave;
-sleep 1;
+source include/wait_for_slave_to_start.inc;
--error 1192
stop slave;
+# Cleanup
+unlock tables;
+
connection master;
drop table t3, t4, t5;
+sync_slave_with_master;
+
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index 8f32ee674f8..26916642cae 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -23,12 +23,12 @@ connection master;
select last_insert_id();
create table t1(a int not null auto_increment, b int, primary key(a) );
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
select last_insert_id();
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-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;
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
@@ -56,7 +56,7 @@ sync_with_master;
insert into t1 values(1,10);
connection master;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
@@ -80,7 +80,7 @@ connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
@@ -105,7 +105,7 @@ connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
@@ -125,7 +125,7 @@ reset master;
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=$engine_type; # no transactions
--error ER_DUP_ENTRY
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
select * from t2;
@@ -141,24 +141,21 @@ alter table t2 drop key day;
connection master;
delete from t2;
--error ER_DUP_ENTRY
-load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
-drop table t2;
+drop table t1, t2;
connection master;
-drop table t2;
-drop table t1;
+drop table t1, t2;
# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error ER_DUP_ENTRY
-LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
---disable_warnings
DROP TABLE IF EXISTS t1;
---enable_warnings
# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index 60ffab316cf..e4ebfd68761 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -9,10 +9,8 @@
# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
# We wait for the slave to have written all he wants to the binlog
# (otherwise RESET MASTER may come too early).
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
--source include/wait_for_slave_to_stop.inc
reset master;
reset slave;
@@ -25,8 +23,13 @@ connection master;
eval create table t1(n int not null auto_increment primary key)ENGINE=$engine_type;
insert into t1 values (NULL);
drop table t1;
+let $LOAD_FILE= ../../std_data/words.dat;
+if (!`SELECT length(load_file('$LOAD_FILE'))`){
+ let $LOAD_FILE= ../$LOAD_FILE;
+}
eval create table t1 (word char(20) not null)ENGINE=$engine_type;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+--replace_result $LOAD_FILE LOAD_FILE
+eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
@@ -67,19 +70,13 @@ eval create table t3 (a int)ENGINE=$engine_type;
connection master;
select * from t1 order by 1 asc;
-save_master_pos;
-connection slave;
-# Note that the above 'slave start' will cause a 3rd rotate event (a fake one)
-# to go into the relay log (the master always sends a fake one when replication
-# starts).
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
-sync_with_master;
+sync_slave_with_master;
+
#check t1 on slave to ensure whether it's identical with on master
select * from t1 order by 1 asc;
flush logs;
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/stop_slave.inc;
+source include/start_slave.inc;
connection master;
# Create some entries for second log
@@ -92,12 +89,11 @@ source include/show_binlog_events.inc;
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002';
+--replace_column 2 #
show binary logs;
-save_master_pos;
-connection slave;
-start slave;
+sync_slave_with_master;
--source include/wait_for_slave_to_start.inc
-sync_with_master;
+--replace_column 2 #
show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
--replace_column 2 # 5 #
@@ -133,9 +129,13 @@ DROP TABLE t3;
# Bug #6880: LAST_INSERT_ID() within a statement
#
+# Reset binlog so that show binlog events will not show the tests
+# above.
+source include/master-slave-reset.inc;
+connection master;
+
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
-reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
source include/show_binlog_events.inc;
@@ -145,4 +145,3 @@ drop table t1;
# End of 4.1 tests
sync_slave_with_master;
-
diff --git a/mysql-test/extra/rpl_tests/rpl_row_001.test b/mysql-test/extra/rpl_tests/rpl_row_001.test
index 6261659c4ce..8eb684e0dff 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_001.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_001.test
@@ -1,7 +1,9 @@
+let $LOAD_FILE= $MYSQLTEST_VARDIR/std_data/words.dat;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+--replace_result $LOAD_FILE LOAD_FILE
+eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
+--replace_result $LOAD_FILE LOAD_FILE
+eval LOAD DATA INFILE '$LOAD_FILE' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word LIMIT 10;
#
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
index 47afcce875b..5a2ab1912b8 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp002.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
@@ -206,7 +206,7 @@ START TRANSACTION;
-- disable_query_log
-- disable_result_log
let $n=50;
-while ($n>3)
+while ($n)
{
eval call test.p3($n);
dec $n;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index 0e391cb0f37..3b03caee35c 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -122,7 +122,7 @@ INSERT INTO t1_nodef VALUES (1,2);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -142,7 +142,7 @@ sync_slave_with_master;
--echo **** On Slave ****
SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
connection master;
@@ -154,7 +154,7 @@ INSERT INTO t4 VALUES (4);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -168,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -182,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36);
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -191,7 +191,7 @@ connection master;
INSERT INTO t9 VALUES (6);
sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
index d007e433ab6..1f5eb5786dd 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
@@ -2,7 +2,7 @@
-- source include/master-slave.inc
create table t1 (word char(20) not null);
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10;
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
index 3304a0ff46d..2c396c9a209 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
@@ -18,13 +18,18 @@ eval create table t1 (a int, unique(a)) engine=$engine_type;
set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
-save_master_pos;
+
--error ER_DUP_ENTRY
insert into t1 values(1),(2);
drop table t1;
-save_master_pos;
+
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
+let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+--echo Error: "$error" (expected different error codes on master and slave)
+--echo Errno: "$errno" (expected 0)
+drop table t1;
# End of 4.1 tests