summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r--mysql-test/suite/rpl/combinations6
-rw-r--r--mysql-test/suite/rpl/data/rpl_bug28618.dat3
-rw-r--r--mysql-test/suite/rpl/data/rpl_mixed.dat3
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc8
-rw-r--r--mysql-test/suite/rpl/my.cnf14
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_corruption.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result298
-rw-r--r--mysql-test/suite/rpl/r/rpl_cross_version.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_view.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_found_rows.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_idempotency.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30919.result1043
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_load_table_from_master.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_conflicts.result109
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result97
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result68
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_m.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mystery22.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result51
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result123
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_conflicts.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mystery22.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_errors.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result4
-rw-r--r--mysql-test/suite/rpl/rpl_1slave_base.cnf50
-rw-r--r--mysql-test/suite/rpl/t/disabled.def1
-rwxr-xr-xmysql-test/suite/rpl/t/rpl000017-slave.sh4
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015-slave.opt (renamed from mysql-test/suite/rpl/t/rpl_000015.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015.cnf2
-rw-r--r--mysql-test/suite/rpl/t/rpl_LD_INFILE.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_db.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test97
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf27
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test324
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version.test36
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_view.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency-slave.opt3
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30919.test68
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_table_from_master.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_charset.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_simple.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_misc_functions.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test37
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt (renamed from mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.cnf6
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_conflicts.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_max_relay_size.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mystery22.test52
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test19
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test176
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test36
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_stop_slave.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_conflicts.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mystery22.test66
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test59
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test95
206 files changed, 2408 insertions, 2055 deletions
diff --git a/mysql-test/suite/rpl/combinations b/mysql-test/suite/rpl/combinations
index ea25611a5d4..07042c2cbec 100644
--- a/mysql-test/suite/rpl/combinations
+++ b/mysql-test/suite/rpl/combinations
@@ -1,8 +1,8 @@
[row]
---binlog-format=row
+binlog-format=row
[stmt]
---binlog-format=statement
+binlog-format=statement
[mix]
---binlog-format=mixed
+binlog-format=mixed
diff --git a/mysql-test/suite/rpl/data/rpl_bug28618.dat b/mysql-test/suite/rpl/data/rpl_bug28618.dat
deleted file mode 100644
index b800c4dd39d..00000000000
--- a/mysql-test/suite/rpl/data/rpl_bug28618.dat
+++ /dev/null
@@ -1,3 +0,0 @@
-1|master only
-2|master only
-3|master only
diff --git a/mysql-test/suite/rpl/data/rpl_mixed.dat b/mysql-test/suite/rpl/data/rpl_mixed.dat
deleted file mode 100644
index 131c57750cc..00000000000
--- a/mysql-test/suite/rpl/data/rpl_mixed.dat
+++ /dev/null
@@ -1,3 +0,0 @@
-10|line A
-20|line B
-30|line C
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index d7041d82a2a..e9adb805c99 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -51,9 +51,8 @@ DELETE FROM t2 WHERE a = 2;
--echo
--echo ******************** LOAD DATA INFILE ********************
---copy_file ./suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
-LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
@@ -329,6 +328,7 @@ DROP VIEW v2;
--echo ******************** SHOW BINLOG EVENTS ********************
--replace_column 2 # 5 #
--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show binlog events from 1;
sync_slave_with_master;
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
@@ -344,4 +344,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/my.cnf b/mysql-test/suite/rpl/my.cnf
new file mode 100644
index 00000000000..ea4caeb2ddd
--- /dev/null
+++ b/mysql-test/suite/rpl/my.cnf
@@ -0,0 +1,14 @@
+# Use settings from rpl_1slave_base.cnf
+# add setting to connect the slave to the master by default
+!include rpl_1slave_base.cnf
+
+[mysqld.2]
+# Hardcode the host to 127.0.0.1 until running on more
+# than one host and it need to be masked
+# master-host= @mysqld.1.#host
+master-host= 127.0.0.1
+master-port= @mysqld.1.port
+master-password= @mysqld.1.#password
+master-user= @mysqld.1.#user
+master-connect-retry= 1
+
diff --git a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index 70013f95d85..b092dd9e088 100644
--- a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
@@ -6,10 +6,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE a = 'abashed';
DELETE FROM test.t1;
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
SELECT * FROM test.t1 ORDER BY a DESC;
a
aberration
diff --git a/mysql-test/suite/rpl/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 6edbe5d427f..60c07d0dede 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
@@ -4,5 +4,9 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-use mysql;
+==== Verify that alter database does not stop replication ====
+create database temp_db;
+use temp_db;
alter database collate latin1_bin;
+==== Clean up ====
+drop database temp_db;
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 083f3a4e901..2a4c3a09361 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -227,3 +227,20 @@ select * from t3 order by a;
a
127
drop table t1,t2,t3;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
new file mode 100644
index 00000000000..f94d2833603
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
@@ -0,0 +1,8 @@
+call mtr.add_suppression('Found invalid event in binary log');
+==== Initialize ====
+Setting up fake replication from MYSQL_TEST_DIR/std_data/bug40482-bin.000001
+==== Test ====
+START SLAVE SQL_THREAD;
+Last_SQL_Error = Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
+==== Clean up ====
+Cleaning up after setup_fake_relay_log.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
index 27094e761b0..954589267c5 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -98,3 +98,4 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
new file mode 100644
index 00000000000..c6dd2d01ed3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -0,0 +1,41 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+==== Initialize ====
+[on master]
+CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
+SHOW CREATE TABLE tinnodb;
+Table Create Table
+tinnodb CREATE TABLE `tinnodb` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+set @old_debug= @@debug;
+set @@debug= 'd,do_not_write_xid';
+==== Test ====
+INSERT INTO tinnodb VALUES (1);
+SELECT * FROM tinnodb ORDER BY a;
+a
+1
+[on slave]
+==== Verify results on slave ====
+include/stop_slave.inc
+SELECT "" AS Slave_IO_State;
+Slave_IO_State
+
+SELECT "" AS Last_SQL_Error;
+Last_SQL_Error
+
+SELECT "" AS Last_IO_Error;
+Last_IO_Error
+
+SELECT * FROM tinnodb ORDER BY a;
+a
+==== Clean up ====
+[on master]
+DROP TABLE tinnodb;
+set @@debug= @old_debug;
+[on slave]
+DROP TABLE tinnodb;
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index 4043f04215b..1b3f2cfc7dc 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -1,6 +1,8 @@
reset master;
+call mtr.add_suppression("Failed during slave.*thread initialization");
stop slave;
reset slave;
+SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
show slave status;
Slave_IO_State #
@@ -41,3 +43,4 @@ Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
+SET GLOBAL debug="";
diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
new file mode 100644
index 00000000000..c3ccc76d1bc
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -0,0 +1,298 @@
+*** Set up circular ring by schema A->B->C->D->A ***
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 1;
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_A_PORT,master_user='root',MASTER_LOG_FILE='MASTER_A_LOG_FILE';
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 2;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',MASTER_LOG_FILE='MASTER_B_LOG_FILE';
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 3;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_C_PORT,master_user='root',MASTER_LOG_FILE='MASTER_C_LOG_FILE';
+SET auto_increment_increment = 4;
+SET auto_increment_offset = 4;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_D_PORT,master_user='root',MASTER_LOG_FILE='MASTER_D_LOG_FILE';
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 1
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 2
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 3
+SHOW VARIABLES LIKE 'auto_increment_%';
+Variable_name Value
+auto_increment_increment 4
+auto_increment_offset 4
+1
+START SLAVE;
+START SLAVE;
+START SLAVE;
+START SLAVE;
+
+*** Preparing data ***
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
+
+*** Testing schema A->B->C->D->A ***
+
+INSERT INTO t1(b,c) VALUES('A',1);
+INSERT INTO t1(b,c) VALUES('B',1);
+INSERT INTO t1(b,c) VALUES('C',1);
+INSERT INTO t1(b,c) VALUES('D',1);
+SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master A a b
+Master A 1 A
+Master A 2 B
+Master A 3 C
+Master A 4 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master B a b
+Master B 1 A
+Master B 2 B
+Master B 3 C
+Master B 4 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master C a b
+Master C 1 A
+Master C 2 B
+Master C 3 C
+Master C 4 D
+SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+Master D a b
+Master D 1 A
+Master D 2 B
+Master D 3 C
+Master D 4 D
+
+*** Testing schema A->B->D->A if C has failure ***
+
+* Do failure for C and then make new connection B->D *
+STOP SLAVE;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
+include/start_slave.inc
+INSERT INTO t1 VALUES(6,'C',2);
+INSERT INTO t1(b,c) VALUES('B',2);
+INSERT INTO t1(b,c) VALUES('A',2);
+INSERT INTO t1(b,c) VALUES('D',2);
+
+* Data on servers (C failed) *
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master A a b
+Master A 5 A
+Master A 8 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master B a b
+Master B 5 A
+Master B 6 B
+Master B 8 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master C a b
+Master C 6 C
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master D a b
+Master D 8 D
+
+* Reconfigure replication to schema A->B->D->A *
+STOP SLAVE;
+STOP SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
+include/start_slave.inc
+
+* Check data inserted before failure *
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master A a b
+Master A 5 A
+Master A 6 B
+Master A 8 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master B a b
+Master B 5 A
+Master B 6 B
+Master B 8 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master C a b
+Master C 6 C
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+Master D a b
+Master D 5 A
+Master D 6 B
+Master D 8 D
+
+* Check data inserted after failure *
+INSERT INTO t1(b,c) VALUES('A',3);
+INSERT INTO t1(b,c) VALUES('B',3);
+INSERT INTO t1(b,c) VALUES('D',3);
+SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master A a b
+Master A 9 A
+Master A 10 B
+Master A 12 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master B a b
+Master B 9 A
+Master B 10 B
+Master B 12 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master C a b
+SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+Master D a b
+Master D 9 A
+Master D 10 B
+Master D 12 D
+
+*** Testing restoring scheme A->B->C->D->A after failure ***
+
+* Remove wrong event from C and restore B->C->D *
+include/stop_slave.inc
+DELETE FROM t1 WHERE a = 6;
+START SLAVE;
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_C_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
+START SLAVE;
+
+* Check data inserted before restoring schema A->B->C->D->A *
+SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master A a b
+Master A 5 A
+Master A 6 B
+Master A 8 D
+Master A 9 A
+Master A 10 B
+Master A 12 D
+SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master B a b
+Master B 5 A
+Master B 6 B
+Master B 8 D
+Master B 9 A
+Master B 10 B
+Master B 12 D
+SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master C a b
+Master C 5 A
+Master C 6 B
+Master C 8 D
+Master C 9 A
+Master C 10 B
+Master C 12 D
+SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+Master D a b
+Master D 5 A
+Master D 6 B
+Master D 8 D
+Master D 9 A
+Master D 10 B
+Master D 12 D
+
+* Check data inserted after restoring schema A->B->C->D->A *
+INSERT INTO t1(b,c) VALUES('A',4);
+INSERT INTO t1(b,c) VALUES('B',4);
+INSERT INTO t1(b,c) VALUES('C',4);
+INSERT INTO t1(b,c) VALUES('D',4);
+SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master A a b
+Master A 13 A
+Master A 14 B
+Master A 15 C
+Master A 16 D
+SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master B a b
+Master B 13 A
+Master B 14 B
+Master B 15 C
+Master B 16 D
+SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master C a b
+Master C 13 A
+Master C 14 B
+Master C 15 C
+Master C 16 D
+SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+Master D a b
+Master D 13 A
+Master D 14 B
+Master D 15 C
+Master D 16 D
+
+* Transactions with commits *
+BEGIN;
+BEGIN;
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master A b COUNT(*)
+Master A A 100
+Master A B 100
+Master A C 100
+Master A D 100
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master B b COUNT(*)
+Master B A 100
+Master B B 100
+Master B C 100
+Master B D 100
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master C b COUNT(*)
+Master C A 100
+Master C B 100
+Master C C 100
+Master C D 100
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+Master D b COUNT(*)
+Master D A 100
+Master D B 100
+Master D C 100
+Master D D 100
+
+* Transactions with rollbacks *
+BEGIN;
+BEGIN;
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master A b COUNT(*)
+Master A B 100
+Master A D 100
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master B b COUNT(*)
+Master B B 100
+Master B D 100
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master C b COUNT(*)
+Master C B 100
+Master C D 100
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+Master D b COUNT(*)
+Master D B 100
+Master D D 100
+
+*** Clean up ***
+DROP TABLE t1,t2;
+STOP SLAVE;
+RESET SLAVE;
+STOP SLAVE;
+RESET SLAVE;
+STOP SLAVE;
+RESET SLAVE;
+STOP SLAVE;
+RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result
new file mode 100644
index 00000000000..de5dd134516
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_cross_version.result
@@ -0,0 +1,12 @@
+==== Initialize ====
+Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
+==== Test ====
+start slave sql_thread;
+==== a prove that the fake has been processed successfully ====
+SELECT COUNT(*) - 17920 as zero FROM t3;
+zero
+0
+==== Clean up ====
+stop slave sql_thread;
+Cleaning up after setup_fake_relay_log.inc
+drop table t1, t3;
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index c0efdf5290d..8825797f80d 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -31,8 +31,7 @@ use test;
select * from t1;
n
1234
-stop slave;
-drop database mysqltest1;
-drop database mysqltest1;
use test;
drop table t1;
+drop database mysqltest1;
+include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-test/suite/rpl/r/rpl_drop_view.result
index ef625464881..c359011612a 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_view.result
@@ -25,3 +25,5 @@ select * from v2;
ERROR 42S02: Table 'test.v2' doesn't exist
select * from v3;
ERROR 42S02: Table 'test.v3' doesn't exist
+==== clean up ====
+drop table t1, t2, t3;
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index e4a412cb1d5..b797183f9d2 100644
--- a/mysql-test/suite/rpl/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -1,10 +1,11 @@
-set global event_scheduler=1;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_event_scheduler = @@global.event_scheduler;
+set global event_scheduler=1;
set binlog_format=row;
DROP EVENT IF EXISTS test.justonce;
drop table if exists t1,t2;
@@ -34,7 +35,7 @@ db name status originator
test justonce SLAVESIDE_DISABLED 1
"Dropping event test.slave_once on the slave"
DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
"Checking event status on the slave for originator value = slave's server_id"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
@@ -45,7 +46,7 @@ DROP EVENT IF EXISTS test.slave_once;
"Dropping event test.justonce on the master"
DROP EVENT IF EXISTS test.justonce;
"Creating event test.er on the master"
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -56,7 +57,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND
db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
"Altering event test.er on the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -75,7 +76,7 @@ db name status originator
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
"Creating event test.slave_terminate on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
@@ -123,7 +124,7 @@ db name status originator
test justonce SLAVESIDE_DISABLED 1
"Dropping event test.slave_once on the slave"
DROP EVENT IF EXISTS test.slave_once;
-CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO
+CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once');
"Checking event status on the slave for originator value = slave's server_id"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once';
@@ -134,7 +135,7 @@ DROP EVENT IF EXISTS test.slave_once;
"Dropping event test.justonce on the master"
DROP EVENT IF EXISTS test.justonce;
"Creating event test.er on the master"
-CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -145,7 +146,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND
db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
"Altering event test.er on the master"
-ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO
+ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
"Checking event status on the master"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
@@ -164,7 +165,7 @@ db name status originator
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
"Creating event test.slave_terminate on the slave"
-CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO
+CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate');
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate';
@@ -190,4 +191,5 @@ select * from t28953;
END;|
ALTER EVENT event1 RENAME TO event2;
DROP EVENT event2;
+SET @@global.event_scheduler= @old_event_scheduler;
DROP TABLE t28953;
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
index fb7f29da656..7eddaabc636 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
@@ -50,82 +50,82 @@ UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
--source include/wait_for_slave_sql_error_and_skip.inc
Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1'
set global sql_slave_skip_counter=1;
-start slave;
+include/start_slave.inc
[on slave]
show tables like 't%';
Tables_in_test (t%)
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index baa740bf250..600ac44fc86 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show variables like 'relay_log%';
Variable_name Value
-relay_log MYSQLTEST_VARDIR/master-data/relay-log
+relay_log MYSQLD_DATADIR/relay-log
relay_log_index
relay_log_info_file relay-log.info
relay_log_purge ON
@@ -18,11 +18,7 @@ start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
+include/start_slave.inc
FLUSH LOGS;
SHOW SLAVE STATUS;
Slave_IO_State #
diff --git a/mysql-test/suite/rpl/r/rpl_found_rows.result b/mysql-test/suite/rpl/r/rpl_found_rows.result
index 25be9eb63b3..45a931872cf 100644
--- a/mysql-test/suite/rpl/r/rpl_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_found_rows.result
@@ -103,10 +103,10 @@ DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
#### 2. Using mixed mode ####
==== 2.1. Checking a procedure ====
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result
index 5a4052864ad..f39d0f1f37f 100644
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result
@@ -4,6 +4,9 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
@@ -220,7 +223,7 @@ Last_SQL_Error
0
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
-set global slave_exec_mode='STRICT';
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
set @@session.binlog_format= @save_binlog_format;
drop table t1,t2,ti2,ti1;
*** end of tests
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index cdc3f5e9579..e77be425270 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -116,7 +116,8 @@ show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
set global slave_exec_mode='IDEMPOTENT';
-drop table t1, t4, mysqltest2.t2;
+drop table t1, mysqltest2.t2;
+drop table t4;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 5ff72e57f0e..908abf56c1f 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set global max_connections=151;
-stop slave;
-start slave;
+include/stop_slave.inc
+include/start_slave.inc
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
@@ -25,6 +25,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
-stop slave;
+include/stop_slave.inc
set global init_connect= @my_global_init_connect;
set global max_connections= default;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb.result b/mysql-test/suite/rpl/r/rpl_innodb.result
index 658f92f4d75..bf6c3cb8c86 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb.result
@@ -12,7 +12,7 @@ PRIMARY KEY (id),
UNIQUE KEY unique_rec (name,number)
) ENGINE=InnoDB;
LOAD DATA
-INFILE '../std_data_ln/loaddata_pair.dat'
+INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
SELECT * FROM t4;
@@ -24,7 +24,7 @@ id name number
1 XXX 12345
2 XXY 12345
LOAD DATA
-INFILE '../std_data_ln/loaddata_pair.dat'
+INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
SELECT * FROM t4;
@@ -43,6 +43,7 @@ CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
SET AUTOCOMMIT = 0;
-------- switch to slave --------
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result
deleted file mode 100644
index 42aa4ff302b..00000000000
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result
+++ /dev/null
@@ -1,1043 +0,0 @@
-use test;
-CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
-dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
-fkid MEDIUMINT, filler VARCHAR(255),
-PRIMARY KEY(id)) ENGINE='innodb'
-PARTITION BY RANGE(id)
-SUBPARTITION BY hash(id) subpartitions 2
-(PARTITION pa3 values less than (42),
-PARTITION pa6 values less than (60),
-PARTITION pa7 values less than (70),
-PARTITION pa8 values less than (80),
-PARTITION pa9 values less than (90),
-PARTITION pa10 values less than (100),
-PARTITION pa11 values less than MAXVALUE);
-CREATE PROCEDURE test.proc_part()
-BEGIN
-DECLARE ins_count INT DEFAULT 1000;
-DECLARE del_count INT;
-DECLARE cur_user VARCHAR(255);
-DECLARE local_uuid VARCHAR(255);
-DECLARE local_time TIMESTAMP;
-SET local_time= NOW();
-SET cur_user= CURRENT_USER();
-SET local_uuid= UUID();
-WHILE ins_count > 0 DO
-INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
-ins_count,'Going to test MBR for MySQL');
-SET ins_count = ins_count - 1;
-END WHILE;
-SELECT MAX(id) FROM test.part_tbl INTO del_count;
-WHILE del_count > 0 DO
-DELETE FROM test.part_tbl WHERE id = del_count;
-select count(*) as internal_count, del_count -- these two lines are for
-FROM test.part_tbl; -- debug to show the problem
-SET del_count = del_count - 2;
-END WHILE;
-END|
-CALL test.proc_part();
-internal_count del_count
-999 1000
-internal_count del_count
-998 998
-internal_count del_count
-997 996
-internal_count del_count
-996 994
-internal_count del_count
-995 992
-internal_count del_count
-994 990
-internal_count del_count
-993 988
-internal_count del_count
-992 986
-internal_count del_count
-991 984
-internal_count del_count
-990 982
-internal_count del_count
-989 980
-internal_count del_count
-988 978
-internal_count del_count
-987 976
-internal_count del_count
-986 974
-internal_count del_count
-985 972
-internal_count del_count
-984 970
-internal_count del_count
-983 968
-internal_count del_count
-982 966
-internal_count del_count
-981 964
-internal_count del_count
-980 962
-internal_count del_count
-979 960
-internal_count del_count
-978 958
-internal_count del_count
-977 956
-internal_count del_count
-976 954
-internal_count del_count
-975 952
-internal_count del_count
-974 950
-internal_count del_count
-973 948
-internal_count del_count
-972 946
-internal_count del_count
-971 944
-internal_count del_count
-970 942
-internal_count del_count
-969 940
-internal_count del_count
-968 938
-internal_count del_count
-967 936
-internal_count del_count
-966 934
-internal_count del_count
-965 932
-internal_count del_count
-964 930
-internal_count del_count
-963 928
-internal_count del_count
-962 926
-internal_count del_count
-961 924
-internal_count del_count
-960 922
-internal_count del_count
-959 920
-internal_count del_count
-958 918
-internal_count del_count
-957 916
-internal_count del_count
-956 914
-internal_count del_count
-955 912
-internal_count del_count
-954 910
-internal_count del_count
-953 908
-internal_count del_count
-952 906
-internal_count del_count
-951 904
-internal_count del_count
-950 902
-internal_count del_count
-949 900
-internal_count del_count
-948 898
-internal_count del_count
-947 896
-internal_count del_count
-946 894
-internal_count del_count
-945 892
-internal_count del_count
-944 890
-internal_count del_count
-943 888
-internal_count del_count
-942 886
-internal_count del_count
-941 884
-internal_count del_count
-940 882
-internal_count del_count
-939 880
-internal_count del_count
-938 878
-internal_count del_count
-937 876
-internal_count del_count
-936 874
-internal_count del_count
-935 872
-internal_count del_count
-934 870
-internal_count del_count
-933 868
-internal_count del_count
-932 866
-internal_count del_count
-931 864
-internal_count del_count
-930 862
-internal_count del_count
-929 860
-internal_count del_count
-928 858
-internal_count del_count
-927 856
-internal_count del_count
-926 854
-internal_count del_count
-925 852
-internal_count del_count
-924 850
-internal_count del_count
-923 848
-internal_count del_count
-922 846
-internal_count del_count
-921 844
-internal_count del_count
-920 842
-internal_count del_count
-919 840
-internal_count del_count
-918 838
-internal_count del_count
-917 836
-internal_count del_count
-916 834
-internal_count del_count
-915 832
-internal_count del_count
-914 830
-internal_count del_count
-913 828
-internal_count del_count
-912 826
-internal_count del_count
-911 824
-internal_count del_count
-910 822
-internal_count del_count
-909 820
-internal_count del_count
-908 818
-internal_count del_count
-907 816
-internal_count del_count
-906 814
-internal_count del_count
-905 812
-internal_count del_count
-904 810
-internal_count del_count
-903 808
-internal_count del_count
-902 806
-internal_count del_count
-901 804
-internal_count del_count
-900 802
-internal_count del_count
-899 800
-internal_count del_count
-898 798
-internal_count del_count
-897 796
-internal_count del_count
-896 794
-internal_count del_count
-895 792
-internal_count del_count
-894 790
-internal_count del_count
-893 788
-internal_count del_count
-892 786
-internal_count del_count
-891 784
-internal_count del_count
-890 782
-internal_count del_count
-889 780
-internal_count del_count
-888 778
-internal_count del_count
-887 776
-internal_count del_count
-886 774
-internal_count del_count
-885 772
-internal_count del_count
-884 770
-internal_count del_count
-883 768
-internal_count del_count
-882 766
-internal_count del_count
-881 764
-internal_count del_count
-880 762
-internal_count del_count
-879 760
-internal_count del_count
-878 758
-internal_count del_count
-877 756
-internal_count del_count
-876 754
-internal_count del_count
-875 752
-internal_count del_count
-874 750
-internal_count del_count
-873 748
-internal_count del_count
-872 746
-internal_count del_count
-871 744
-internal_count del_count
-870 742
-internal_count del_count
-869 740
-internal_count del_count
-868 738
-internal_count del_count
-867 736
-internal_count del_count
-866 734
-internal_count del_count
-865 732
-internal_count del_count
-864 730
-internal_count del_count
-863 728
-internal_count del_count
-862 726
-internal_count del_count
-861 724
-internal_count del_count
-860 722
-internal_count del_count
-859 720
-internal_count del_count
-858 718
-internal_count del_count
-857 716
-internal_count del_count
-856 714
-internal_count del_count
-855 712
-internal_count del_count
-854 710
-internal_count del_count
-853 708
-internal_count del_count
-852 706
-internal_count del_count
-851 704
-internal_count del_count
-850 702
-internal_count del_count
-849 700
-internal_count del_count
-848 698
-internal_count del_count
-847 696
-internal_count del_count
-846 694
-internal_count del_count
-845 692
-internal_count del_count
-844 690
-internal_count del_count
-843 688
-internal_count del_count
-842 686
-internal_count del_count
-841 684
-internal_count del_count
-840 682
-internal_count del_count
-839 680
-internal_count del_count
-838 678
-internal_count del_count
-837 676
-internal_count del_count
-836 674
-internal_count del_count
-835 672
-internal_count del_count
-834 670
-internal_count del_count
-833 668
-internal_count del_count
-832 666
-internal_count del_count
-831 664
-internal_count del_count
-830 662
-internal_count del_count
-829 660
-internal_count del_count
-828 658
-internal_count del_count
-827 656
-internal_count del_count
-826 654
-internal_count del_count
-825 652
-internal_count del_count
-824 650
-internal_count del_count
-823 648
-internal_count del_count
-822 646
-internal_count del_count
-821 644
-internal_count del_count
-820 642
-internal_count del_count
-819 640
-internal_count del_count
-818 638
-internal_count del_count
-817 636
-internal_count del_count
-816 634
-internal_count del_count
-815 632
-internal_count del_count
-814 630
-internal_count del_count
-813 628
-internal_count del_count
-812 626
-internal_count del_count
-811 624
-internal_count del_count
-810 622
-internal_count del_count
-809 620
-internal_count del_count
-808 618
-internal_count del_count
-807 616
-internal_count del_count
-806 614
-internal_count del_count
-805 612
-internal_count del_count
-804 610
-internal_count del_count
-803 608
-internal_count del_count
-802 606
-internal_count del_count
-801 604
-internal_count del_count
-800 602
-internal_count del_count
-799 600
-internal_count del_count
-798 598
-internal_count del_count
-797 596
-internal_count del_count
-796 594
-internal_count del_count
-795 592
-internal_count del_count
-794 590
-internal_count del_count
-793 588
-internal_count del_count
-792 586
-internal_count del_count
-791 584
-internal_count del_count
-790 582
-internal_count del_count
-789 580
-internal_count del_count
-788 578
-internal_count del_count
-787 576
-internal_count del_count
-786 574
-internal_count del_count
-785 572
-internal_count del_count
-784 570
-internal_count del_count
-783 568
-internal_count del_count
-782 566
-internal_count del_count
-781 564
-internal_count del_count
-780 562
-internal_count del_count
-779 560
-internal_count del_count
-778 558
-internal_count del_count
-777 556
-internal_count del_count
-776 554
-internal_count del_count
-775 552
-internal_count del_count
-774 550
-internal_count del_count
-773 548
-internal_count del_count
-772 546
-internal_count del_count
-771 544
-internal_count del_count
-770 542
-internal_count del_count
-769 540
-internal_count del_count
-768 538
-internal_count del_count
-767 536
-internal_count del_count
-766 534
-internal_count del_count
-765 532
-internal_count del_count
-764 530
-internal_count del_count
-763 528
-internal_count del_count
-762 526
-internal_count del_count
-761 524
-internal_count del_count
-760 522
-internal_count del_count
-759 520
-internal_count del_count
-758 518
-internal_count del_count
-757 516
-internal_count del_count
-756 514
-internal_count del_count
-755 512
-internal_count del_count
-754 510
-internal_count del_count
-753 508
-internal_count del_count
-752 506
-internal_count del_count
-751 504
-internal_count del_count
-750 502
-internal_count del_count
-749 500
-internal_count del_count
-748 498
-internal_count del_count
-747 496
-internal_count del_count
-746 494
-internal_count del_count
-745 492
-internal_count del_count
-744 490
-internal_count del_count
-743 488
-internal_count del_count
-742 486
-internal_count del_count
-741 484
-internal_count del_count
-740 482
-internal_count del_count
-739 480
-internal_count del_count
-738 478
-internal_count del_count
-737 476
-internal_count del_count
-736 474
-internal_count del_count
-735 472
-internal_count del_count
-734 470
-internal_count del_count
-733 468
-internal_count del_count
-732 466
-internal_count del_count
-731 464
-internal_count del_count
-730 462
-internal_count del_count
-729 460
-internal_count del_count
-728 458
-internal_count del_count
-727 456
-internal_count del_count
-726 454
-internal_count del_count
-725 452
-internal_count del_count
-724 450
-internal_count del_count
-723 448
-internal_count del_count
-722 446
-internal_count del_count
-721 444
-internal_count del_count
-720 442
-internal_count del_count
-719 440
-internal_count del_count
-718 438
-internal_count del_count
-717 436
-internal_count del_count
-716 434
-internal_count del_count
-715 432
-internal_count del_count
-714 430
-internal_count del_count
-713 428
-internal_count del_count
-712 426
-internal_count del_count
-711 424
-internal_count del_count
-710 422
-internal_count del_count
-709 420
-internal_count del_count
-708 418
-internal_count del_count
-707 416
-internal_count del_count
-706 414
-internal_count del_count
-705 412
-internal_count del_count
-704 410
-internal_count del_count
-703 408
-internal_count del_count
-702 406
-internal_count del_count
-701 404
-internal_count del_count
-700 402
-internal_count del_count
-699 400
-internal_count del_count
-698 398
-internal_count del_count
-697 396
-internal_count del_count
-696 394
-internal_count del_count
-695 392
-internal_count del_count
-694 390
-internal_count del_count
-693 388
-internal_count del_count
-692 386
-internal_count del_count
-691 384
-internal_count del_count
-690 382
-internal_count del_count
-689 380
-internal_count del_count
-688 378
-internal_count del_count
-687 376
-internal_count del_count
-686 374
-internal_count del_count
-685 372
-internal_count del_count
-684 370
-internal_count del_count
-683 368
-internal_count del_count
-682 366
-internal_count del_count
-681 364
-internal_count del_count
-680 362
-internal_count del_count
-679 360
-internal_count del_count
-678 358
-internal_count del_count
-677 356
-internal_count del_count
-676 354
-internal_count del_count
-675 352
-internal_count del_count
-674 350
-internal_count del_count
-673 348
-internal_count del_count
-672 346
-internal_count del_count
-671 344
-internal_count del_count
-670 342
-internal_count del_count
-669 340
-internal_count del_count
-668 338
-internal_count del_count
-667 336
-internal_count del_count
-666 334
-internal_count del_count
-665 332
-internal_count del_count
-664 330
-internal_count del_count
-663 328
-internal_count del_count
-662 326
-internal_count del_count
-661 324
-internal_count del_count
-660 322
-internal_count del_count
-659 320
-internal_count del_count
-658 318
-internal_count del_count
-657 316
-internal_count del_count
-656 314
-internal_count del_count
-655 312
-internal_count del_count
-654 310
-internal_count del_count
-653 308
-internal_count del_count
-652 306
-internal_count del_count
-651 304
-internal_count del_count
-650 302
-internal_count del_count
-649 300
-internal_count del_count
-648 298
-internal_count del_count
-647 296
-internal_count del_count
-646 294
-internal_count del_count
-645 292
-internal_count del_count
-644 290
-internal_count del_count
-643 288
-internal_count del_count
-642 286
-internal_count del_count
-641 284
-internal_count del_count
-640 282
-internal_count del_count
-639 280
-internal_count del_count
-638 278
-internal_count del_count
-637 276
-internal_count del_count
-636 274
-internal_count del_count
-635 272
-internal_count del_count
-634 270
-internal_count del_count
-633 268
-internal_count del_count
-632 266
-internal_count del_count
-631 264
-internal_count del_count
-630 262
-internal_count del_count
-629 260
-internal_count del_count
-628 258
-internal_count del_count
-627 256
-internal_count del_count
-626 254
-internal_count del_count
-625 252
-internal_count del_count
-624 250
-internal_count del_count
-623 248
-internal_count del_count
-622 246
-internal_count del_count
-621 244
-internal_count del_count
-620 242
-internal_count del_count
-619 240
-internal_count del_count
-618 238
-internal_count del_count
-617 236
-internal_count del_count
-616 234
-internal_count del_count
-615 232
-internal_count del_count
-614 230
-internal_count del_count
-613 228
-internal_count del_count
-612 226
-internal_count del_count
-611 224
-internal_count del_count
-610 222
-internal_count del_count
-609 220
-internal_count del_count
-608 218
-internal_count del_count
-607 216
-internal_count del_count
-606 214
-internal_count del_count
-605 212
-internal_count del_count
-604 210
-internal_count del_count
-603 208
-internal_count del_count
-602 206
-internal_count del_count
-601 204
-internal_count del_count
-600 202
-internal_count del_count
-599 200
-internal_count del_count
-598 198
-internal_count del_count
-597 196
-internal_count del_count
-596 194
-internal_count del_count
-595 192
-internal_count del_count
-594 190
-internal_count del_count
-593 188
-internal_count del_count
-592 186
-internal_count del_count
-591 184
-internal_count del_count
-590 182
-internal_count del_count
-589 180
-internal_count del_count
-588 178
-internal_count del_count
-587 176
-internal_count del_count
-586 174
-internal_count del_count
-585 172
-internal_count del_count
-584 170
-internal_count del_count
-583 168
-internal_count del_count
-582 166
-internal_count del_count
-581 164
-internal_count del_count
-580 162
-internal_count del_count
-579 160
-internal_count del_count
-578 158
-internal_count del_count
-577 156
-internal_count del_count
-576 154
-internal_count del_count
-575 152
-internal_count del_count
-574 150
-internal_count del_count
-573 148
-internal_count del_count
-572 146
-internal_count del_count
-571 144
-internal_count del_count
-570 142
-internal_count del_count
-569 140
-internal_count del_count
-568 138
-internal_count del_count
-567 136
-internal_count del_count
-566 134
-internal_count del_count
-565 132
-internal_count del_count
-564 130
-internal_count del_count
-563 128
-internal_count del_count
-562 126
-internal_count del_count
-561 124
-internal_count del_count
-560 122
-internal_count del_count
-559 120
-internal_count del_count
-558 118
-internal_count del_count
-557 116
-internal_count del_count
-556 114
-internal_count del_count
-555 112
-internal_count del_count
-554 110
-internal_count del_count
-553 108
-internal_count del_count
-552 106
-internal_count del_count
-551 104
-internal_count del_count
-550 102
-internal_count del_count
-549 100
-internal_count del_count
-548 98
-internal_count del_count
-547 96
-internal_count del_count
-546 94
-internal_count del_count
-545 92
-internal_count del_count
-544 90
-internal_count del_count
-543 88
-internal_count del_count
-542 86
-internal_count del_count
-541 84
-internal_count del_count
-540 82
-internal_count del_count
-539 80
-internal_count del_count
-538 78
-internal_count del_count
-537 76
-internal_count del_count
-536 74
-internal_count del_count
-535 72
-internal_count del_count
-534 70
-internal_count del_count
-533 68
-internal_count del_count
-532 66
-internal_count del_count
-531 64
-internal_count del_count
-530 62
-internal_count del_count
-529 60
-internal_count del_count
-528 58
-internal_count del_count
-527 56
-internal_count del_count
-526 54
-internal_count del_count
-525 52
-internal_count del_count
-524 50
-internal_count del_count
-523 48
-internal_count del_count
-522 46
-internal_count del_count
-521 44
-internal_count del_count
-520 42
-internal_count del_count
-519 40
-internal_count del_count
-518 38
-internal_count del_count
-517 36
-internal_count del_count
-516 34
-internal_count del_count
-515 32
-internal_count del_count
-514 30
-internal_count del_count
-513 28
-internal_count del_count
-512 26
-internal_count del_count
-511 24
-internal_count del_count
-510 22
-internal_count del_count
-509 20
-internal_count del_count
-508 18
-internal_count del_count
-507 16
-internal_count del_count
-506 14
-internal_count del_count
-505 12
-internal_count del_count
-504 10
-internal_count del_count
-503 8
-internal_count del_count
-502 6
-internal_count del_count
-501 4
-internal_count del_count
-500 2
-select count(*) as Part from test.part_tbl;
-Part
-500
-DROP PROCEDURE test.proc_part;
-DROP TABLE test.part_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
index 85308442fd8..fbb1e2355c3 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
@@ -77,7 +77,7 @@ t1 CREATE TABLE `t1` (
`b` char(254) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `index1` (`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -85,7 +85,7 @@ t2 CREATE TABLE `t2` (
`b` char(254) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `index1` (`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
******************** DDL for indexes ********************
ALTER TABLE t2 ADD COLUMN d datetime;
@@ -120,7 +120,7 @@ t1 CREATE TABLE `t1` (
`b` char(254) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `index1` (`b`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -131,7 +131,7 @@ t2 CREATE TABLE `t2` (
KEY `index1` (`b`),
KEY `index2` (`d`),
KEY `index3` (`a`,`d`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t2 DROP COLUMN d;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index d70d8dadf54..8602718ba46 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -103,7 +103,7 @@ DELETE FROM t1;
DELETE FROM t2;
******************** LOAD DATA INFILE ********************
-LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
SELECT * FROM t1 ORDER BY a;
a b
10 line A
@@ -885,7 +885,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
+master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
master-bin.000001 # Xid 1 # #
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
diff --git a/mysql-test/suite/rpl/r/rpl_load_table_from_master.result b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
index c24f857d829..9d9a1d7d6cb 100644
--- a/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
+++ b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
@@ -29,9 +29,9 @@ drop table t1;
drop table t1;
set SQL_LOG_BIN=0;
create table t1 (word char(20) not null, index(word))ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
create table t2 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key)ENGINE=MyISAM;
load table t1 from master;
load table t2 from master;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index 070c50db3d5..d7a02bc84a5 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -9,12 +9,12 @@ select last_insert_id();
last_insert_id()
0
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;
select last_insert_id();
last_insert_id()
1
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;
select * from t1;
@@ -31,7 +31,7 @@ drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
set global sql_slave_skip_counter=1;
start slave;
show slave status;
@@ -40,7 +40,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
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;
stop slave;
change master to master_user='test';
change master to master_user='root';
@@ -52,7 +52,7 @@ start slave;
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;
stop slave;
reset slave;
show slave status;
@@ -61,7 +61,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
-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;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
@@ -76,14 +76,13 @@ day id category name
2003-03-22 2161 c asdf
alter table t2 drop key day;
delete from t2;
-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;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
-drop table t2;
-drop table t2;
-drop table t1;
+drop table t1, t2;
+drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
-LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index 929d06e74cf..7ba67150cb9 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
@@ -5,17 +5,17 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a varchar(10) character set utf8);
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
+load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
hex(a)
C3BF
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index a4d67754bd6..27fb8623e85 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -45,7 +45,7 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 9dbae6d38c4..a1294d515fa 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
@@ -7,20 +7,21 @@ start slave;
drop database if exists mysqltest;
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1;
SELECT COUNT(*) FROM test.t1;
COUNT(*)
2
CREATE DATABASE mysqltest;
USE mysqltest;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
SHOW DATABASES;
Database
information_schema
+mtr
mysql
mysqltest
test
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 4fc33eee20d..779a3af9631 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
create table test.t1(a int, b int, unique(b));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
select count(*) from test.t1;
count(*)
2
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 196093211b6..5e3923616ed 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
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;
SELECT * FROM t1 ORDER BY word;
word
Aarhus
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index bb1b0610aa8..96de55e9dcf 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
@@ -5,19 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(a int);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
-load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
select a,count(*) from t1 group by a;
a count(*)
1 10000
drop table t1;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
-select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
-load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 7487693a9f7..7a5a7bc50c9 100644
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
@@ -8,11 +8,11 @@ DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
INSERT INTO test.t1 VALUES(1,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=1;
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=2;
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
end|
CALL test.p1();
SELECT * FROM test.t1 ORDER BY blob_column;
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index e0c4dedde10..7b3ebf62959 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -7,7 +7,7 @@ start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
-stop slave;
+include/stop_slave.inc
change master to master_log_pos=75;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -49,7 +49,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+include/stop_slave.inc
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index a8e5520ca8f..28b777822e4 100644
--- a/mysql-test/suite/rpl/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -14,8 +14,8 @@ set sql_log_bin=1;
insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1;
-create table t2 like t1;
-load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
+create temporary table t2 like t1;
+load data local infile 'MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
id i r1 r2 p id i r1 r2 p
drop table t1;
@@ -41,9 +41,9 @@ CALL test_replication_sp2();
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
-select * from t1 into outfile "../tmp/t1_slave.txt";
+select * from t1 into outfile "../../tmp/t1_slave.txt";
create temporary table t1_slave select * from t1 where 1=0;
-load data infile '../tmp/t1_slave.txt' into table t1_slave;
+load data infile '../../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1 join t1_slave using (id)
where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
SELECT @aux;
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
index 38972a4f571..08d3241c48f 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
@@ -14,7 +14,7 @@ n
2002
show slave hosts;
Server_id Host Port Rpl_recovery_rank Master_id
-2 127.0.0.1 9999 2 1
+2 127.0.0.1 9999 0 1
drop table t1;
stop slave;
create table t2(id int auto_increment primary key, created datetime);
diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index 7cb7d873415..e26777c15ce 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
@@ -4,13 +4,10 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create database if not exists mysqltest1;
-use mysqltest1;
drop table if exists t1;
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
-use mysqltest1;
alter table t1 engine=myisam;
show create table t1;
Table Create Table
@@ -55,7 +52,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -89,7 +86,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -123,7 +120,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -172,7 +169,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -206,7 +203,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -240,7 +237,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -289,7 +286,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -323,7 +320,7 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -357,10 +354,9 @@ id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
-DELETE FROM mysqltest1.t1 WHERE id = 42;
+DELETE FROM t1 WHERE id = 42;
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
id hex(b1) vc bc d f total y t
DROP TABLE t1;
-DROP DATABASE mysqltest1;
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index f89d6b3459a..4c64054e348 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -8,8 +8,8 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
-STOP SLAVE;
-START SLAVE;
+include/stop_slave.inc
+include/start_slave.inc
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
@@ -27,46 +27,13 @@ SLAVE_RUNNING ON
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
-STOP SLAVE;
-START SLAVE;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+include/stop_slave.inc
+include/start_slave.inc
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running No
-Slave_SQL_Running #
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
-Last_IO_Error
-Last_SQL_Errno 0
-Last_SQL_Error
+Slave_IO_Running = No (expect No)
+==== clean up ====
+DROP TABLE t1;
+SET @@global.max_allowed_packet= 1024;
+SET @@global.net_buffer_length= 1024;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index faba43ae934..89e822b3eb6 100644
--- a/mysql-test/suite/rpl/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -68,6 +68,7 @@ test latin1_swedish_ci
DROP DATABASE mysqltest1;
use test;
+DROP TABLE t1;
# Connection: slave
diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
index 8f145b94046..0551240eb8a 100644
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_binlog_format= @@global.binlog_format;
SET BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
@@ -65,7 +66,6 @@ Last_SQL_Error
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 # Query 2 # use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9
slave-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG)
slave-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
slave-bin.000001 # Query 1 # use `test`; BEGIN
@@ -73,3 +73,4 @@ slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # use `test`; COMMIT
DROP TABLE IF EXISTS t1;
+SET @@global.binlog_format= @old_binlog_format;
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index d854a2d0f8d..33088ee2ec8 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -9,7 +9,7 @@ drop table if exists t11;
create table t2 (n int);
insert into t2 values(4);
create table t2 (s char(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
insert into t2 values('five');
create table t1 (m int);
insert into t1 values(15),(16),(17);
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 1b843bffdca..76dd574191f 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -24,7 +24,7 @@ drop database if exists rewrite;
create database rewrite;
use test;
create table t1 (a date, b date, c date not null, d date);
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'c' at row 1
@@ -32,7 +32,7 @@ Warning 1265 Data truncated for column 'd' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
select * from rewrite.t1;
a b c d
0000-00-00 NULL 0000-00-00 0000-00-00
@@ -40,7 +40,7 @@ a b c d
2003-03-03 2003-03-03 2003-03-03 NULL
2003-03-03 2003-03-03 2003-03-03 NULL
truncate table t1;
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1
@@ -53,7 +53,7 @@ NULL 0000-00-00 0000-00-00 0000-00-00
NULL 2003-03-03 2003-03-03 NULL
drop table t1;
create table t1 (a text, b text);
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
@@ -65,7 +65,7 @@ Field 3,'Field 4|
|Field 6| | 'Field 7'|
drop table t1;
create table t1 (a int, b char(10));
-load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
@@ -79,7 +79,7 @@ a b
3 row 3
0 1234567890
truncate table t1;
-load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: '
' for column 'a' at row 4
diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index fad60af664f..0d682eb82e1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
+LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word LIMIT 10;
word
Aarhus
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index 670456ba6fd..1504c16bd7e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -9,6 +9,7 @@ CREATE DATABASE test_ignore;
SHOW DATABASES;
Database
information_schema
+mtr
mysql
test
test_ignore
@@ -35,6 +36,7 @@ master-bin.000001 # Query # # use `test`; COMMIT
SHOW DATABASES;
Database
information_schema
+mtr
mysql
test
USE test;
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index 77148fc688c..a980092ac37 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 8d071d503bc..ea0c322fe6d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
new file mode 100644
index 00000000000..0f15bfc7156
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
@@ -0,0 +1,109 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
+[on slave]
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
+######## Run with slave_exec_mode=STRICT ########
+SET @@global.slave_exec_mode = 'STRICT';
+==== Initialize ====
+[on master]
+CREATE TABLE t1(a INT PRIMARY KEY);
+[on slave]
+==== Test: SQL thread sees 'INSERT' of existing key ====
+---- Prepare slave so that it will get duplicate key error ----
+INSERT INTO t1 VALUES (1);
+---- Insert rows on master ----
+[on master]
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+[on slave]
+---- Wait until slave stops with an error ----
+Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 346 (expected "duplicate key" error)
+SELECT * FROM t1;
+a
+1
+---- Resolve the conflict on the slave and restart SQL thread ----
+DELETE FROM t1 WHERE a = 1;
+START SLAVE SQL_THREAD;
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = '' (expected no error)
+SELECT * FROM t1;
+a
+1
+==== Test: SQL thread sees 'DELETE' of non-existing row ====
+---- On master, insert two rows, the second with binlogging off ----
+[on master]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[on slave]
+DELETE FROM t1 WHERE a = 1;
+---- On master, remove the row that does not exist on slave ----
+[on master]
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+[on slave]
+---- Wait until slave stops with an error ----
+Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 982 (expected "can't find record" error)
+SELECT * FROM t1;
+a
+---- Resolve the conflict on the slave and restart SQL thread ----
+INSERT INTO t1 VALUES (1);
+START SLAVE SQL_THREAD;
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = (expected no error)
+SELECT * FROM t1;
+a
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
+######## Run with slave_exec_mode=IDEMPOTENT ########
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+==== Initialize ====
+[on master]
+CREATE TABLE t1(a INT PRIMARY KEY);
+[on slave]
+==== Test: SQL thread sees 'INSERT' of existing key ====
+---- Prepare slave so that it will get duplicate key error ----
+INSERT INTO t1 VALUES (1);
+---- Insert rows on master ----
+[on master]
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+[on slave]
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = '' (expected no error)
+SELECT * FROM t1;
+a
+1
+==== Test: SQL thread sees 'DELETE' of non-existing row ====
+---- On master, insert two rows, the second with binlogging off ----
+[on master]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[on slave]
+DELETE FROM t1 WHERE a = 1;
+---- On master, remove the row that does not exist on slave ----
+[on master]
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+[on slave]
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = (expected no error)
+SELECT * FROM t1;
+a
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index ad659c37b7f..29f58632fde 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -4,34 +4,39 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
-SHOW BINLOG EVENTS FROM 216;
+SHOW BINLOG EVENTS FROM 106;
Log_name #
-Pos 216
+Pos 106
Event_type Query
Server_id #
-End_log_pos 309
+End_log_pos 199
Info use `test`; CREATE TABLE t1 (a INT, b INT)
Log_name #
-Pos 309
+Pos 199
Event_type Query
Server_id #
-End_log_pos 415
+End_log_pos 305
Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
Log_name #
-Pos 415
+Pos 305
Event_type Query
Server_id #
-End_log_pos 521
+End_log_pos 411
Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
Log_name #
-Pos 521
+Pos 411
Event_type Query
Server_id #
-End_log_pos 640
+End_log_pos 530
Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
**** On Master ****
SHOW CREATE TABLE t1;
@@ -125,9 +130,14 @@ NULL 3 6
NULL 4 2
NULL 5 10
NULL 6 12
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
ERROR 23000: Duplicate entry '2' for key 'b'
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
CREATE TABLE t7 (a INT, b INT UNIQUE);
INSERT INTO t7 SELECT a,b FROM tt3;
@@ -137,18 +147,23 @@ a b
1 2
2 4
3 6
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1374 Query # 1474 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-# 1474 Query # 1542 use `test`; BEGIN
-# 1542 Table_map # 1584 table_id: # (test.t7)
-# 1584 Write_rows # 1640 table_id: # flags: STMT_END_F
-# 1640 Query # 1711 use `test`; ROLLBACK
+# 106 Query # 206 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+# 206 Query # 274 use `test`; BEGIN
+# 274 Table_map # 316 table_id: # (test.t7)
+# 316 Write_rows # 372 table_id: # flags: STMT_END_F
+# 372 Query # 443 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
2 4
3 6
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
BEGIN;
@@ -156,12 +171,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SHOW BINLOG EVENTS FROM 1711;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1711 Query # 1779 use `test`; BEGIN
-# 1779 Table_map # 1821 table_id: # (test.t7)
-# 1821 Write_rows # 1877 table_id: # flags: STMT_END_F
-# 1877 Query # 1946 use `test`; COMMIT
+# 106 Query # 174 use `test`; BEGIN
+# 174 Table_map # 216 table_id: # (test.t7)
+# 216 Write_rows # 272 table_id: # flags: STMT_END_F
+# 272 Query # 343 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -178,6 +193,11 @@ a b
4 8
5 10
6 12
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
CREATE TEMPORARY TABLE tt5 LIKE t4;
@@ -196,10 +216,10 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 1946;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1946 Query # 2032 use `test`; CREATE TABLE t8 LIKE t4
-# 2032 Query # 2171 use `test`; CREATE TABLE `t9` (
+# 106 Query # 192 use `test`; CREATE TABLE t8 LIKE t4
+# 192 Query # 331 use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
@@ -276,9 +296,8 @@ a
1
2
3
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@@ -308,7 +327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 1329 Query # 1397 use `test`; BEGIN
# 1397 Table_map # 1438 table_id: # (test.t1)
# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
-# 1482 Query # 1551 use `test`; COMMIT
+# 1482 Query # 1553 use `test`; ROLLBACK
SHOW TABLES;
Tables_in_test
t1
@@ -371,9 +390,8 @@ a
4
6
9
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
# 192 Query # 260 use `test`; BEGIN
# 260 Table_map # 301 table_id: # (test.t1)
@@ -394,6 +412,11 @@ a
6
9
TRUNCATE TABLE t2;
+**** Resetting master and slave ****
+include/stop_slave.inc
+RESET SLAVE;
+RESET MASTER;
+include/start_slave.inc
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -406,14 +429,14 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * FROM t2 ORDER BY a;
a
-SHOW BINLOG EVENTS FROM 949;
+SHOW BINLOG EVENTS FROM 106;
Log_name Pos Event_type Server_id End_log_pos Info
-# 949 Query # 1017 use `test`; BEGIN
-# 1017 Table_map # 1058 table_id: # (test.t2)
-# 1058 Write_rows # 1102 table_id: # flags: STMT_END_F
-# 1102 Table_map # 1143 table_id: # (test.t2)
-# 1143 Write_rows # 1182 table_id: # flags: STMT_END_F
-# 1182 Query # 1253 use `test`; ROLLBACK
+# 106 Query # 174 use `test`; BEGIN
+# 174 Table_map # 215 table_id: # (test.t2)
+# 215 Write_rows # 259 table_id: # flags: STMT_END_F
+# 259 Table_map # 300 table_id: # (test.t2)
+# 300 Write_rows # 339 table_id: # flags: STMT_END_F
+# 339 Query # 410 use `test`; ROLLBACK
SELECT * FROM t2 ORDER BY a;
a
DROP TABLE t1,t2;
@@ -436,11 +459,13 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE TABLE mysqltest1.without_select (f1 BIGINT);
CREATE TABLE mysqltest1.with_select AS SELECT 1 AS f1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # DROP DATABASE IF EXISTS mysqltest1
master-bin.000001 # Query # # CREATE DATABASE mysqltest1
master-bin.000001 # Query # # use `test`; CREATE TABLE mysqltest1.without_select (f1 BIGINT)
master-bin.000001 # Query # # use `test`; BEGIN
diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
index 04db52c840b..18a5dbfccc1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -30,4 +30,5 @@ flush tables with read lock;
start slave;
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
drop table t3, t4, t5;
diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
index 1dd97878666..562e3dc2862 100644
--- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -4,56 +4,18 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create table t1 (a int not null primary key);
-insert into t1 values (1);
-create table t2 (a int);
-insert into t2 values (1);
-update t1, t2 set t1.a = 0 where t1.a = t2.a;
-show tables;
-Tables_in_test
-t1
-select * from t1;
-a
-0
-drop table t1;
-insert into t1 values (1);
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port MASTER_PORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos 1153
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table #
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1146
-Last_Error Error 'Table 'test.t1' doesn't exist' on opening tables
-Skip_Counter 0
-Exec_Master_Log_Pos 941
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1146
-Last_SQL_Error Error 'Table 'test.t1' doesn't exist' on opening tables
-drop table t1, t2;
+==== Setup table on master but not on slave ====
+[on master]
+CREATE TABLE t1 (a INT);
+[on slave]
+DROP TABLE t1;
+==== Modify table on master ====
+[on master]
+INSERT INTO t1 VALUES (1);
+==== Verify error on slave ====
+[on slave]
+Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
+==== Clean up ====
+include/stop_slave.inc
+[on master]
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
index 149efddaf8d..198e55c71d0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
@@ -9,7 +9,7 @@ stop slave;
create database mysqltest;
use mysqltest;
create table t1(a int, b int, unique(b));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # #
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index c0d70bb0cdd..b76cc6aa15e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -113,10 +113,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-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
select * from t1 order by 1 asc;
word
Aarhus
@@ -189,7 +185,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -217,13 +214,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # use `test`; COMMIT
show binary logs;
Log_name File_size
-master-bin.000001 1540
-master-bin.000002 516
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1638
-slave-bin.000002 417
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -292,13 +288,23 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
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());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index 790038799c0..809c50e1465 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=InnoDB;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -113,10 +113,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-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
select * from t1 order by 1 asc;
word
Aarhus
@@ -189,7 +185,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=InnoDB;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -217,13 +214,12 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Xid 1 # COMMIT /* XID */
show binary logs;
Log_name File_size
-master-bin.000001 1456
-master-bin.000002 474
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1536
-slave-bin.000002 366
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -292,13 +288,23 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
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());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 392f5904233..2215b34814e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -1,5 +1,3 @@
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 2d9d801047b..2cb316c6a1f 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -159,7 +159,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -181,7 +181,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -290,7 +290,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -321,7 +321,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_row_mystery22.result b/mysql-test/suite/rpl/r/rpl_row_mystery22.result
deleted file mode 100644
index 5e42a89d741..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_mystery22.result
+++ /dev/null
@@ -1,32 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-create table t1(n int auto_increment primary key, s char(10));
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-insert into t1 values (2,'old');
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-select * from t1 order by n;
-n s
-1 new
-2 new
-delete from t1 where n = 2;
-start slave;
-stop slave;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-start slave;
-select * from t1 order by n;
-n s
-1 new
-3 new
-drop table t1;
-set @@global.slave_exec_mode= default;
diff --git a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
index 0fd4ff86893..1934b01505c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (words varchar(20)) engine=myisam;
-load data infile '../std_data_ln/words.dat' into table t1 (words);
+load data infile '../../std_data/words.dat' into table t1 (words);
select count(*) from t1;
count(*)
70
@@ -13,4 +13,5 @@ select count(*) from t1;
count(*)
70
drop table t1;
+include/stop_slave.inc
drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index e81d4f7454e..a6a2181cd2a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -140,7 +140,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1364
Last_SQL_Error <Last_SQL_Error>
@@ -191,7 +191,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
@@ -232,7 +232,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -275,7 +275,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -318,7 +318,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -360,7 +360,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index a6834be5a86..02e8c074354 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -140,7 +140,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1364
Last_SQL_Error <Last_SQL_Error>
@@ -191,7 +191,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
@@ -232,7 +232,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -275,7 +275,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -318,7 +318,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 1535
Last_SQL_Error <Last_SQL_Error>
@@ -360,7 +360,7 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
-Last_IO_Errno 0
+Last_IO_Errno <Last_IO_Errno>
Last_IO_Error <Last_IO_Error>
Last_SQL_Errno 0
Last_SQL_Error <Last_SQL_Error>
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index f544ef95702..be1ec51f74a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -149,8 +149,8 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
+include/stop_slave.inc
+start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -162,7 +162,7 @@ Read_Master_Log_Pos 1161
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
+Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
@@ -200,7 +200,7 @@ start slave until relay_log_file='slave-relay-bin.000002';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave sql_thread;
+start slave;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
Warnings:
Note 1254 Slave is already running
diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
index 724f0071e07..76f187e3b01 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id1.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
-stop slave;
+include/stop_slave.inc
change master to master_port=SLAVE_PORT;
start slave;
*** must be having the replicate-same-server-id IO thread error ***
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index f68f9ff829d..bb5a175fbfe 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -8,45 +8,6 @@ create table t1 (n int);
reset master;
stop slave;
change master to master_port=SLAVE_PORT;
-show slave status;
-Slave_IO_State
-Master_Host 127.0.0.1
-Master_User root
-Master_Port SLAVE_PORT
-Connect_Retry 1
-Master_Log_File
-Read_Master_Log_Pos 4
-Relay_Log_File slave-relay-bin.000001
-Relay_Log_Pos 4
-Relay_Master_Log_File
-Slave_IO_Running No
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table #
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos 0
-Relay_Log_Space 106
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master NULL
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
start slave;
insert into t1 values (1);
select * from t1;
@@ -55,3 +16,15 @@ n
1
stop slave;
drop table t1;
+reset master;
+create table t1(n int);
+create table t2(n int);
+change master to master_port=MASTER_PORT;
+start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS;
+*** checking until postion execution: must be only t1 in the list ***
+show tables;
+Tables_in_test
+t1
+start slave sql_thread;
+drop table t1;
+drop table t2;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
new file mode 100644
index 00000000000..eb3c4ef5978
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -0,0 +1,123 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+
+*** Preparing data ***
+CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+CREATE TRIGGER tr1 BEFORE UPDATE ON t1
+FOR EACH ROW BEGIN
+UPDATE t2 SET b='YY' WHERE a=NEW.a;
+END|
+CREATE TRIGGER tr2 AFTER UPDATE ON t1
+FOR EACH ROW BEGIN
+UPDATE t3 SET b='ZZ' WHERE a=NEW.a;
+END|
+
+*** Test non-transactional group w/o PK ***
+INSERT INTO t3 VALUES(1, 'AA');
+INSERT INTO t2 VALUES(1, 'AA');
+INSERT INTO t1 VALUES(1, 'AA');
+RENAME TABLE t3 TO t3_bak;
+UPDATE t1 SET b = 'XX' WHERE a = 1;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 XX
+SELECT * FROM t2 ORDER BY a;
+a b
+1 YY
+SELECT * FROM t3 ORDER BY a;
+a b
+1 ZZ
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t3_bak
+SELECT * FROM t1 ORDER BY a;
+a b
+1 AA_for_row_or_XX_for_stmt_mixed
+SELECT * FROM t2 ORDER BY a;
+a b
+1 AA_for_row_or_YY_for_stmt_mixed
+include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+include/start_slave.inc
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+
+*** Test non-transactional group w/ PK ***
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+ALTER TABLE t2 ADD PRIMARY KEY (a);
+ALTER TABLE t3 ADD PRIMARY KEY (a);
+RENAME TABLE t3 TO t3_bak;
+INSERT INTO t3 VALUES(2, 'B');
+INSERT INTO t2 VALUES(2, 'B');
+INSERT INTO t1 VALUES(2, 'B');
+UPDATE t1 SET b = 'X' WHERE a = 2;
+SELECT * FROM t1 ORDER BY a;
+a b
+2 X
+SELECT * FROM t2 ORDER BY a;
+a b
+2 YY
+SELECT * FROM t3 ORDER BY a;
+a b
+2 ZZ
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t3_bak
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT * FROM t2 ORDER BY a;
+a b
+include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+include/start_slave.inc
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+
+*** Test transactional group w/ PK ***
+ALTER TABLE t1 ENGINE=InnoDB;
+ALTER TABLE t2 ENGINE=InnoDB;
+ALTER TABLE t3 ENGINE=InnoDB;
+RENAME TABLE t3 TO t3_bak;
+BEGIN;
+INSERT INTO t1 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t2 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
+COMMIT;
+SELECT * FROM t1 ORDER BY a;
+a b
+3 C
+4 D
+SELECT * FROM t2 ORDER BY a;
+a b
+3 C
+4 D
+SELECT * FROM t3 ORDER BY a;
+a b
+3 C
+4 D
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+t2
+t3_bak
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT * FROM t2 ORDER BY a;
+a b
+include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+include/start_slave.inc
+*** Clean up ***
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index bb03c3b6cca..747e8f235a8 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -166,7 +166,7 @@ BEGIN
UPDATE t3 SET a =2, b = 'master only';
END|
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
**** On Master ****
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1;
@@ -174,6 +174,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
SELECT * FROM t1 ORDER BY a;
a b
2 master only
@@ -188,7 +189,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a b
1 master/slave
@@ -208,7 +209,7 @@ CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (2, 'master only');
@@ -234,7 +235,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -245,7 +246,7 @@ SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (6, 'master only');
@@ -277,7 +278,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -287,7 +288,7 @@ a b
SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
-STOP SLAVE;
+include/stop_slave.inc
SET AUTOCOMMIT=0;
INSERT INTO t4 VALUES (4, 'master only');
INSERT INTO t5 VALUES (4, 'master only');
@@ -323,7 +324,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -341,10 +342,10 @@ DROP TABLE t4, t5, t6;
*** On Master ***
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
*** On Slave ***
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
SET SESSION BINLOG_FORMAT=STATEMENT;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
a b
1 master only
@@ -352,7 +353,7 @@ a b
3 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
DROP TABLE t10;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index b435af499df..a98a81dc74f 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -6,31 +6,30 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
==== Create new replication user ====
[on master]
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
[on slave]
-stop slave;
-change master to master_user='rpl',master_password='rpl';
-start slave;
+include/stop_slave.inc
+CHANGE MASTER TO master_user='rpl', master_password='rpl';
+include/start_slave.inc
==== Do replication as new user ====
[on master]
-create table t1 (n int);
-insert into t1 values (1);
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES (1);
[on slave]
-select * from t1;
+SELECT * FROM t1;
n
1
==== Delete new replication user ====
[on master]
-drop user rpl@127.0.0.1;
-flush privileges;
+DROP USER rpl@127.0.0.1;
+FLUSH PRIVILEGES;
[on slave]
==== Restart slave without privileges =====
-stop slave;
-start slave;
+include/stop_slave.inc
+START SLAVE;
==== Verify that Slave_IO_Running = No ====
Slave_IO_Running = No (should be No)
==== Cleanup (Note that slave IO thread is not running) ====
-drop table t1;
-delete from mysql.user where user='rpl';
+DROP TABLE t1;
[on master]
-drop table t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 3ca4f86cf64..4a8a4050c02 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -191,11 +191,15 @@ begin
return unix_timestamp();
end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_routine_creators=1;
Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
create function fn2()
returns int
@@ -549,8 +553,14 @@ insert into t values (1);
return 0;
end
master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
-set global log_bin_trust_function_creators=0;
-set global log_bin_trust_function_creators=0;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+Warnings:
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+Warnings:
+Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use '@@log_bin_trust_function_creators' instead
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database mysqltest;
drop database mysqltest2;
use test;
@@ -605,7 +615,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index a39d189aa3a..d9cdfd81167 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
drop function if exists f1;
@@ -275,5 +276,5 @@ E
drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 3b4cd05f640..24e454eb876 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
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;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10;
word
diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
index 13aa45d8ced..e69952787fb 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
@@ -11,3 +11,6 @@ set sql_log_bin=1;
insert into t1 values(1),(2);
ERROR 23000: Duplicate entry '2' for key 'a'
drop table t1;
+Error: "Query caused different errors on master and slave. Error on master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on slave: 'no error' (0). Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
+Errno: "0" (expected 0)
+drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
new file mode 100644
index 00000000000..b0df9516b7c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
@@ -0,0 +1,54 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+==== Initialize ====
+[on master]
+CREATE TABLE t1(a INT PRIMARY KEY);
+[on slave]
+==== Test: SQL thread sees 'INSERT' of existing key ====
+---- Prepare slave so that it will get duplicate key error ----
+INSERT INTO t1 VALUES (1);
+---- Insert rows on master ----
+[on master]
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+[on slave]
+---- Wait until slave stops with an error ----
+Last_SQL_Error = Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' (expected "duplicate key" error)
+SELECT * FROM t1;
+a
+1
+---- Resolve the conflict on the slave and restart SQL thread ----
+DELETE FROM t1 WHERE a = 1;
+START SLAVE SQL_THREAD;
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = '' (expected no error)
+SELECT * FROM t1;
+a
+1
+==== Test: SQL thread sees 'DELETE' of non-existing row ====
+---- On master, insert two rows, the second with binlogging off ----
+[on master]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[on slave]
+DELETE FROM t1 WHERE a = 1;
+---- On master, remove the row that does not exist on slave ----
+[on master]
+DELETE FROM t1 WHERE a = 1;
+SELECT * FROM t1;
+a
+[on slave]
+---- Sync slave and verify that there is no error ----
+Last_SQL_Error = (expected no error)
+SELECT * FROM t1;
+a
+==== Clean up ====
+[on master]
+DROP TABLE t1;
+[on slave]
diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index bc14c443f48..ea2a9ce9a79 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
@@ -30,4 +30,5 @@ flush tables with read lock;
start slave;
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
drop table t3, t4, t5;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 20f8e04afe7..715d4976a95 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
start slave;
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
@@ -25,7 +25,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
-master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
show binlog events from 106 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
@@ -109,10 +109,6 @@ Aberdeen
Abernathy
aberrant
aberration
-
-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
select * from t1 order by 1 asc;
word
Aarhus
@@ -185,7 +181,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -196,7 +193,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query # # use `test`; drop table t1
master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=#
master-bin.000001 # Rotate # # master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info
@@ -206,13 +203,12 @@ master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
show binary logs;
Log_name File_size
-master-bin.000001 1347
-master-bin.000002 392
-start slave;
+master-bin.000001 #
+master-bin.000002 #
show binary logs;
Log_name File_size
-slave-bin.000001 1447
-slave-bin.000002 293
+slave-bin.000001 #
+slave-bin.000002 #
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
@@ -222,7 +218,7 @@ slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
slave-bin.000001 # Query 1 # use `test`; drop table t1
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
-slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4;
@@ -274,13 +270,21 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find tar
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
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());
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Intvar # # INSERT_ID=1
+master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, 1)
master-bin.000001 # Intvar # # LAST_INSERT_ID=1
master-bin.000001 # Intvar # # INSERT_ID=5
master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id())
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mystery22.result b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
deleted file mode 100644
index ea34b308ec2..00000000000
--- a/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
+++ /dev/null
@@ -1,31 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-create table t1(n int auto_increment primary key, s char(10));
-insert into t1 values (2,'old');
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-select * from t1 order by n;
-n s
-1 new
-2 old
-delete from t1 where n = 2;
-start slave;
-stop slave;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-start slave;
-select * from t1 order by n;
-n s
-1 new
-2 new
-3 new
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 619115aa534..55074f0be0d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -4,7 +4,10 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+[on slave]
+include/stop_slave.inc
+==== Create some events on master ====
+[on master]
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -12,6 +15,8 @@ create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
+==== Replicate one event at a time on slave ====
+[on slave]
start slave until master_log_file='master-bin.000001', master_log_pos=323;
select * from t1;
n
@@ -149,7 +154,9 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+[on master]
+[on slave]
+include/stop_slave.inc
start slave until master_log_file='master-bin.000001', master_log_pos=776;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -190,6 +197,7 @@ Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
+==== Test various error conditions ====
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index d8fea78ecb4..568d5368adb 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
reset master;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
index 430e63c5859..d14380a6369 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+call mtr.add_suppression("Deadlock found");
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
index cd71dbe628e..927756dd530 100644
--- a/mysql-test/suite/rpl/r/rpl_timezone.result
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
@@ -42,7 +42,7 @@ t n
2004-06-11 09:39:02 6
delete from t1;
set time_zone='UTC';
-load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
+load data infile '../../std_data/rpl_timezone2.dat' into table t1;
Warnings:
Warning 1265 Data truncated for column 't' at row 1
Warning 1261 Row 1 doesn't contain data for all columns
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 68c82ed037f..3d7757613a7 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -862,6 +862,9 @@ drop table t21,t31;
drop table t11;
STOP SLAVE;
FLUSH LOGS;
+--> Stop master server
+--> Start master server
+--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
RESET SLAVE;
START SLAVE;
SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
@@ -975,3 +978,22 @@ a b
2 b
3 c
drop table t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+after insert on t1
+for each row insert into log values ( new.f );
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.log and slave:test.log
+drop table t1, log;
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index 1ae98706975..92e13064856 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
@@ -10,6 +10,8 @@ DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET GLOBAL BINLOG_FORMAT=STATEMENT;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
@@ -42,12 +44,16 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
@@ -80,12 +86,16 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
@@ -121,12 +131,16 @@ master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET GLOBAL BINLOG_FORMAT=STATEMENT;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
@@ -159,12 +173,16 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001 # Query # # use `test`; DELETE FROM t1
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
@@ -197,12 +215,16 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
master-bin.000001 # Query # # use `test`; DELETE FROM t1
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
@@ -242,3 +264,5 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index 728b8450314..94461c33c46 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
@@ -10,6 +10,8 @@ DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET GLOBAL BINLOG_FORMAT=STATEMENT;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
@@ -46,12 +48,16 @@ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
@@ -88,12 +94,16 @@ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
@@ -131,12 +141,16 @@ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET GLOBAL BINLOG_FORMAT=STATEMENT;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
@@ -173,12 +187,16 @@ master-bin.000001 # Query # # use `test`; DELETE FROM t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
@@ -215,12 +233,16 @@ master-bin.000001 # Query # # use `test`; DELETE FROM t1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
+SET @old_session_binlog_format= @@session.binlog_format;
+SET @old_global_binlog_format= @@global.binlog_format;
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
@@ -260,3 +282,5 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; DROP TABLE t1
RESET MASTER;
+SET @@session.binlog_format= @old_session_binlog_format;
+SET @@global.binlog_format= @old_global_binlog_format;
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 902340f0219..b3108c75a6e 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -40,10 +40,10 @@ SET @user_num = 10;
SET @user_text = 'Alunda';
[on master]
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
[on slave]
SET @@global.init_slave = 'SELECT 1';
[on master]
diff --git a/mysql-test/suite/rpl/rpl_1slave_base.cnf b/mysql-test/suite/rpl/rpl_1slave_base.cnf
new file mode 100644
index 00000000000..23b7ded9a7d
--- /dev/null
+++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf
@@ -0,0 +1,50 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+
+# Run the master.sh script before starting this process
+#!run-master-sh
+
+log-bin= master-bin
+
+loose-innodb
+
+[mysqld.2]
+# Run the slave.sh script before starting this process
+#!run-slave-sh
+
+# Append <testname>-slave.opt file to the list of argument used when
+# starting the mysqld
+#!use-slave-opt
+
+log-bin= slave-bin
+relay-log= slave-relay-bin
+
+init-rpl-role= slave
+log-slave-updates
+master-retry-count= 10
+
+# Values reported by slave when it connect to master
+# and shows up in SHOW SLAVE STATUS;
+report-host= 127.0.0.1
+report-port= @mysqld.2.port
+report-user= root
+
+skip-slave-start
+
+# Directory where slaves find the dumps generated by "load data"
+# on the server. The path need to have constant length otherwise
+# test results will vary, thus a relative path is used.
+slave-load-tmpdir= ../../tmp
+
+loose-innodb
+
+
+[ENV]
+MASTER_MYPORT= @mysqld.1.port
+MASTER_MYSOCK= @mysqld.1.socket
+
+SLAVE_MYPORT= @mysqld.2.port
+SLAVE_MYSOCK= @mysqld.2.socket
+
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 8cae44a3607..f3f329c4b5b 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,3 +10,4 @@
#
##############################################################################
+rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
diff --git a/mysql-test/suite/rpl/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh
index 17188aba0db..1d95798260a 100755
--- a/mysql-test/suite/rpl/t/rpl000017-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl000017-slave.sh
@@ -1,6 +1,6 @@
rm -f $MYSQLTEST_VARDIR/log/*relay*
-rm -f $MYSQLTEST_VARDIR/slave-data/relay-log.info
-cat > $MYSQLTEST_VARDIR/slave-data/master.info <<EOF
+rm -f $MYSQLTEST_VARDIR/mysqld.2/data/relay-log.info
+cat > $MYSQLTEST_VARDIR/mysqld.2/data/master.info <<EOF
master-bin.000001
4
127.0.0.1
diff --git a/mysql-test/suite/rpl/t/rpl000018-master.opt b/mysql-test/suite/rpl/t/rpl000018-master.opt
deleted file mode 100644
index ad2c6a647b5..00000000000
--- a/mysql-test/suite/rpl/t/rpl000018-master.opt
+++ /dev/null
@@ -1 +0,0 @@
--O max_binlog_size=4096
diff --git a/mysql-test/suite/rpl/t/rpl000018-slave.opt b/mysql-test/suite/rpl/t/rpl000018-slave.opt
deleted file mode 100644
index e854f0d0bb2..00000000000
--- a/mysql-test/suite/rpl/t/rpl000018-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-slave-start --abort-slave-event-count=1
diff --git a/mysql-test/suite/rpl/t/rpl_000015.slave-mi b/mysql-test/suite/rpl/t/rpl_000015-slave.opt
index 28bc753dd56..28bc753dd56 100644
--- a/mysql-test/suite/rpl/t/rpl_000015.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_000015-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_000015.cnf b/mysql-test/suite/rpl/t/rpl_000015.cnf
new file mode 100644
index 00000000000..46f8af242c2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000015.cnf
@@ -0,0 +1,2 @@
+!include ../rpl_1slave_base.cnf
+
diff --git a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
index bace5d4c1f5..ae647ed6648 100644
--- a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
+++ b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
@@ -16,10 +16,10 @@ DROP TABLE IF EXISTS test.t1;
# Section 1 test
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
DELETE FROM test.t1 WHERE a = 'abashed';
DELETE FROM test.t1;
-LOAD DATA INFILE '../std_data_ln/words2.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
SELECT * FROM test.t1 ORDER BY a DESC;
diff --git a/mysql-test/suite/rpl/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test
index 5ac8a2f4018..341496350d7 100644
--- a/mysql-test/suite/rpl/t/rpl_alter_db.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_db.test
@@ -1,10 +1,14 @@
source include/master-slave.inc;
-connection master;
-use mysql; # to be different from initial `test' db of mysqltest client
-alter database collate latin1_bin;
-save_master_pos;
-connection slave;
-sync_with_master;
+--echo ==== Verify that alter database does not stop replication ====
+create database temp_db;
+use temp_db; # to be different from initial `test' db of mysqltest client
+alter database collate latin1_bin;
+sync_slave_with_master;
+
+--echo ==== Clean up ====
+connection master;
+drop database temp_db;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
new file mode 100644
index 00000000000..815a8f81d32
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
@@ -0,0 +1 @@
+--replicate-same-server-id --relay-log=slave-relay-bin
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
new file mode 100644
index 00000000000..39799180f8b
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
@@ -0,0 +1,42 @@
+# ==== Purpose ====
+#
+# Verify that the slave stops gracefully when reading a relay log with
+# corrupted data.
+#
+# ==== Implementation ====
+#
+# Setup "fake replication" where the slave only starts the SQL thread,
+# not the IO thread, and reads from an existing relay log that has
+# been prepared so that it contains the error. This requires some
+# extra server options: see the -master.opt file.
+#
+# ==== Related bugs ====
+#
+# BUG#31793: log event corruption causes crash
+# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
+
+source include/have_log_bin.inc;
+# BUG#40482 only manifested itself in debug-compiled binaries.
+source include/have_debug.inc;
+
+call mtr.add_suppression('Found invalid event in binary log');
+
+
+#
+# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
+#
+# The relay log contains an Incident_log_event with a non-existing
+# incident number.
+
+--echo ==== Initialize ====
+let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
+source include/setup_fake_relay_log.inc;
+
+--echo ==== Test ====
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_error.inc;
+let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+--echo Last_SQL_Error = $error
+
+--echo ==== Clean up ====
+source include/cleanup_fake_relay_log.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
index e95f69a3f99..31163927ce2 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -42,3 +42,4 @@ show grants for x@y;
show binlog events;
drop user x@y;
drop database d1;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test b/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
index d8e25b244fa..d56a32ce2bd 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
@@ -16,8 +16,9 @@ reset master;
create table t1 (a int);
insert into t1 values (1);
+let $MYSQLD_DATADIR= `select @@datadir`;
flush logs;
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug36099.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug36099.sql
drop table t1;
--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/bug36099.sql"
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test
index e8dfbd51552..6bf66422d62 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole.test
@@ -78,3 +78,7 @@ source extra/rpl_tests/rpl_blackhole.test;
# Test delete, key
let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
source extra/rpl_tests/rpl_blackhole.test;
+
+
+connection master;
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
new file mode 100644
index 00000000000..97c152d52e9
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -0,0 +1,97 @@
+# ==== Purpose ====
+#
+# Tests that an autocommitted XA transaction where the master crashes
+# just before writing the XID log event is executed correctly. The
+# master rolls back, so the slave should not execute statement.
+#
+# This test was previously part of rpl_ndb_transaction.test
+#
+#
+# ==== Method ====
+#
+# We want master to be alive so that it can replicate the statement to
+# the slave. So in the test case, we must not crash the
+# master. Instead, we fake the crash by just not writing the XID event
+# to the binlog. This is done by the @@debug='d,do_not_write_xid'
+# flag. This, in turn, requires us to do 'source
+# include/have_debug.inc'
+#
+# So, unlike if the master had crashed, the master *will* execute the
+# statement. But the slave should not execute it. Hence, after the
+# test is executed, the expected result on master is a table with one
+# row, and on slave a table with no rows.
+#
+# To simulate the slave correctly, we wait until everything up to but
+# not including the XID is replicated. This has to be done with
+# include/sync_slave_io_with_master.inc, not sync_slave_with_master,
+# since the latter waits until the slave *SQL* thread has caught up
+# with the master's position, which it will never do.
+#
+#
+# ==== Related bugs ====
+#
+# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
+
+source include/have_innodb.inc;
+# have_debug is needed since we use the @@debug variable on master
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+
+--echo ==== Initialize ====
+
+--echo [on master]
+--connection master
+
+CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
+SHOW CREATE TABLE tinnodb;
+
+# do_not_write_xid stops the master from writing an XID event.
+set @old_debug= @@debug;
+set @@debug= 'd,do_not_write_xid';
+
+
+--echo ==== Test ====
+
+# Save the position up to which the slave SQL thread should execute.
+save_master_pos;
+
+# Execute query and check that the row made it to the table.
+INSERT INTO tinnodb VALUES (1);
+SELECT * FROM tinnodb ORDER BY a;
+
+# Sync slave's IO thread.
+--echo [on slave]
+source include/sync_slave_io_with_master.inc;
+
+# Sync slave's SQL thread.
+sync_with_master 0;
+
+
+--echo ==== Verify results on slave ====
+
+source include/stop_slave.inc;
+let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
+eval SELECT "$tmp" AS Slave_IO_State;
+let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+eval SELECT "$tmp" AS Last_SQL_Error;
+let $tmp= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
+eval SELECT "$tmp" AS Last_IO_Error;
+SELECT * FROM tinnodb ORDER BY a;
+
+
+--echo ==== Clean up ====
+
+# Easiest to clean up master and slave separately, without
+# replication, since master and slave are out of sync.
+
+--echo [on master]
+connection master;
+DROP TABLE tinnodb;
+set @@debug= @old_debug;
+
+--echo [on slave]
+connection slave;
+DROP TABLE tinnodb;
+
+# Warning: do not add more tests here. The binlog is in a bad state.
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931-slave.opt b/mysql-test/suite/rpl/t/rpl_bug33931-slave.opt
deleted file mode 100644
index 55fe328a41d..00000000000
--- a/mysql-test/suite/rpl/t/rpl_bug33931-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test
index 788f79d4c1c..a439b346538 100644
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test
@@ -13,10 +13,18 @@ connection master;
reset master;
connection slave;
+
+# Add suppression for expected warnings in slaves error log
+call mtr.add_suppression("Failed during slave.*thread initialization");
+
--disable_warnings
stop slave;
--enable_warnings
reset slave;
+
+# Set debug flags on slave to force errors to occur
+SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
+
start slave;
connection master;
@@ -33,5 +41,8 @@ source include/wait_for_slave_to_stop.inc;
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical show slave status;
-# no clean-up is needed
+#
+# Cleanup
+#
+SET GLOBAL debug="";
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
new file mode 100644
index 00000000000..141aaa7788d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
@@ -0,0 +1,27 @@
+!include ../my.cnf
+
+[mysqld.1]
+log-slave-updates
+innodb
+
+[mysqld.2]
+log-slave-updates
+innodb
+
+[mysqld.3]
+log-slave-updates
+innodb
+
+[mysqld.4]
+log-slave-updates
+innodb
+
+[ENV]
+SLAVE_MYPORT1= @mysqld.3.port
+SLAVE_MYSOCK1= @mysqld.3.socket
+
+SLAVE_MYPORT2= @mysqld.4.port
+SLAVE_MYSOCK2= @mysqld.4.socket
+
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
new file mode 100644
index 00000000000..a49253f90c1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -0,0 +1,324 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/12/2008
+# Purpose: Testing circular replication based on schema
+# A->B->C->D->A with using AUTO_INCREMENT_INCREMENT,
+# AUTO_INCREMENT_OFFSET variables and failover
+#############################################################
+--source include/have_innodb.inc
+
+# Set up circular ring and new names for servers
+--echo *** Set up circular ring by schema A->B->C->D->A ***
+--source include/circular_rpl_for_4_hosts_init.inc
+--echo
+
+# Preparing data.
+--echo *** Preparing data ***
+--connection master_a
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
+--source include/circular_rpl_for_4_hosts_sync.inc
+--connection master_d
+--echo
+
+#
+# Testing
+#
+
+--echo *** Testing schema A->B->C->D->A ***
+--echo
+# insert data via all hosts
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',1);
+--sync_slave_with_master master_b
+INSERT INTO t1(b,c) VALUES('B',1);
+--sync_slave_with_master master_c
+INSERT INTO t1(b,c) VALUES('C',1);
+--sync_slave_with_master master_d
+INSERT INTO t1(b,c) VALUES('D',1);
+
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
+--echo
+
+--echo *** Testing schema A->B->D->A if C has failure ***
+--echo
+--echo * Do failure for C and then make new connection B->D *
+# Do not replicate next event from C
+--connection master_d
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+STOP SLAVE;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
+source include/start_slave.inc;
+disconnect slave;
+--connection master_c
+INSERT INTO t1 VALUES(6,'C',2);
+--save_master_pos
+--connection master_b
+INSERT INTO t1(b,c) VALUES('B',2);
+# Wait while C will stop.
+--connection master_c
+source include/wait_for_slave_sql_to_stop.inc;
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',2);
+--connection master_d
+INSERT INTO t1(b,c) VALUES('D',2);
+
+
+# Sync all servers except C
+--connection master_b
+let $wait_condition= SELECT COUNT(*)=3 FROM t1 WHERE a > 4;
+--source include/wait_condition.inc
+
+--echo
+--echo * Data on servers (C failed) *
+# Masters C,D shouldn't have correct data
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--echo
+
+--echo * Reconfigure replication to schema A->B->D->A *
+# Exclude Master C
+--connection master_c
+STOP SLAVE;
+--let $pos_c= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
+--let $file_c= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
+--connection master_d
+STOP SLAVE;
+--replace_result $SLAVE_MYPORT MASTER_B_PORT $file_c LOG_FILE $pos_c LOG_POS
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
+connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+source include/start_slave.inc;
+disconnect slave;
+--connection master_b
+--sync_slave_with_master master_d
+--sync_slave_with_master master_a
+--echo
+
+--echo * Check data inserted before failure *
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
+--echo
+
+--echo * Check data inserted after failure *
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',3);
+--connection master_b
+INSERT INTO t1(b,c) VALUES('B',3);
+--connection master_d
+INSERT INTO t1(b,c) VALUES('D',3);
+connection master_a;
+
+--sync_slave_with_master master_b
+--sync_slave_with_master master_d
+--sync_slave_with_master master_a
+--sync_slave_with_master master_b
+
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
+--connection master_a
+--echo
+
+--echo *** Testing restoring scheme A->B->C->D->A after failure ***
+--echo
+# Master D will ignore a next event from C so that event will not be
+# distributed to other servers
+--echo * Remove wrong event from C and restore B->C->D *
+--connection master_d
+source include/stop_slave.inc;
+--connection master_c
+DELETE FROM t1 WHERE a = 6;
+START SLAVE;
+--connection master_b
+--sync_slave_with_master master_c
+RESET MASTER;
+--let $file_d= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $pos_d= query_get_value(SHOW MASTER STATUS, Position, 1)
+--connection master_d
+RESET SLAVE;
+--replace_result $SLAVE_MYPORT1 MASTER_C_PORT $file_d LOG_FILE $pos_d LOG_POS
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root',master_log_file='$file_d',master_log_pos=$pos_d
+START SLAVE;
+--connection master_c
+--sync_slave_with_master master_d
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--echo
+--echo * Check data inserted before restoring schema A->B->C->D->A *
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_b
+SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_c
+SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_d
+SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
+--sync_slave_with_master master_a
+--echo
+
+--echo * Check data inserted after restoring schema A->B->C->D->A *
+--connection master_a
+INSERT INTO t1(b,c) VALUES('A',4);
+--connection master_b
+INSERT INTO t1(b,c) VALUES('B',4);
+--connection master_c
+INSERT INTO t1(b,c) VALUES('C',4);
+--connection master_d
+INSERT INTO t1(b,c) VALUES('D',4);
+--connection master_a
+
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--connection master_a
+SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_b
+SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_c
+SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_d
+SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
+--connection master_a
+--echo
+
+--echo * Transactions with commits *
+# Testing mixing of transactions and regular inserts
+--connection master_a
+BEGIN;
+--connection master_c
+BEGIN;
+let $counter= 100;
+--connection master_a
+--disable_query_log
+while ($counter) {
+ --connection master_a
+ INSERT INTO t2(b,c) VALUES('A',1);
+ --connection master_b
+ INSERT INTO t2(b,c) VALUES('B',1);
+ --connection master_c
+ INSERT INTO t2(b,c) VALUES('C',1);
+ --connection master_d
+ INSERT INTO t2(b,c) VALUES('D',1);
+ dec $counter;
+}
+--connection master_a
+COMMIT;
+--connection master_c
+COMMIT;
+--connection master_a
+--enable_query_log
+
+
+--let $wait_condition= SELECT COUNT(*)=400 FROM t2 WHERE c = 1
+--connection master_a
+--source include/wait_condition.inc
+--connection master_b
+--source include/wait_condition.inc
+--connection master_c
+--source include/wait_condition.inc
+--connection master_d
+--source include/wait_condition.inc
+
+--connection master_a
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_b
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_c
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_d
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
+--connection master_a
+--echo
+
+--echo * Transactions with rollbacks *
+# Testing mixing of transactions with rollback and regular inserts
+--connection master_a
+BEGIN;
+--connection master_c
+BEGIN;
+let $counter= 100;
+--connection master_a
+--disable_query_log
+while ($counter) {
+ --connection master_a
+ INSERT INTO t2(b,c) VALUES('A',2);
+ --connection master_b
+ INSERT INTO t2(b,c) VALUES('B',2);
+ --connection master_c
+ INSERT INTO t2(b,c) VALUES('C',2);
+ --connection master_d
+ INSERT INTO t2(b,c) VALUES('D',2);
+ dec $counter;
+}
+--connection master_a
+ROLLBACK;
+--connection master_c
+ROLLBACK;
+--connection master_a
+--enable_query_log
+
+--let $wait_condition= SELECT COUNT(*)=200 FROM t2 WHERE c = 2
+--connection master_a
+--source include/wait_condition.inc
+--connection master_b
+--source include/wait_condition.inc
+--connection master_c
+--source include/wait_condition.inc
+--connection master_d
+--source include/wait_condition.inc
+
+--connection master_a
+SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_b
+SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_c
+SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_d
+SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
+--connection master_a
+
+--echo
+
+# Clean up
+--echo *** Clean up ***
+--connection master_a
+DROP TABLE t1,t2;
+--source include/circular_rpl_for_4_hosts_sync.inc
+
+--connection master_a
+STOP SLAVE;
+RESET SLAVE;
+--connection master_b
+STOP SLAVE;
+RESET SLAVE;
+--connection master_c
+STOP SLAVE;
+RESET SLAVE;
+--connection master_d
+STOP SLAVE;
+RESET SLAVE;
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
new file mode 100644
index 00000000000..0ea05290c11
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
@@ -0,0 +1 @@
+--replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test
new file mode 100644
index 00000000000..adeba7f2b15
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_cross_version.test
@@ -0,0 +1,36 @@
+# ==== Purpose ====
+#
+# Verify cross-version replication from an old master to the up-to-date slave
+#
+# ==== Implementation ====
+#
+# Feed to the slave server a binlog recorded on an old version master
+# via setting up slave-to-slave replication. The latter is done by means of
+# the opt file and include/setup_fake_relay_log.inc.
+# The master's binlog is treated as a relay log that the SQL thread executes.
+#
+
+--source include/have_log_bin.inc
+--source include/not_windows.inc
+#
+# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails
+#
+
+--echo ==== Initialize ====
+# the relay log contains create t1, t3 tables and load data infile
+--let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
+--source include/setup_fake_relay_log.inc
+
+--echo ==== Test ====
+start slave sql_thread;
+--let $slave_param = Exec_Master_Log_Pos
+# end_log_pos of the last event of the relay log
+--let $slave_param_value = 149436
+--source include/wait_for_slave_param.inc
+--echo ==== a prove that the fake has been processed successfully ====
+SELECT COUNT(*) - 17920 as zero FROM t3;
+
+--echo ==== Clean up ====
+stop slave sql_thread;
+--source include/cleanup_fake_relay_log.inc
+drop table t1, t3;
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
index c52c239a1a1..3819e7c3f7b 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
@@ -1 +1 @@
---innodb --innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
+--innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index 7f4a7843c4a..11e93e7307a 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -47,15 +47,15 @@ use test;
select * from t1;
#cleanup
-connection slave;
-stop slave;
-drop database mysqltest1;
-
connection master;
+
# Remove the "extra" file created above
---remove_file $MYSQLTEST_VARDIR/master-data/mysqltest1/f1.txt
-drop database mysqltest1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/mysqltest1/f1.txt;
use test;
drop table t1;
+drop database mysqltest1;
+sync_slave_with_master;
+source include/stop_slave.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-test/suite/rpl/t/rpl_drop_view.test
index 8d826b8214d..11633a0a7e8 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_view.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_view.test
@@ -29,3 +29,8 @@ select * from v1;
select * from v2;
--error 1146
select * from v3;
+
+--echo ==== clean up ====
+connection master;
+drop table t1, t2, t3;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
index 7ab9064b7f6..9efb3d16d2b 100644
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
@@ -12,7 +12,8 @@ source include/have_innodb.inc;
# set up "dual head"
-let $keep_connection= 1;
+# Needed for debug info in wait_for_slave_sql_to_stop.
+let $master_connection= slave;
connection slave;
reset master;
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 2a9cf86fe55..d06a3118389 100644
--- a/mysql-test/suite/rpl/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -5,11 +5,12 @@
# in both row based and statement based format #
##################################################################
-set global event_scheduler=1;
-
--source include/not_embedded.inc
--source include/master-slave.inc
+SET @old_event_scheduler = @@global.event_scheduler;
+set global event_scheduler=1;
+
let $engine_type= MyISAM;
set binlog_format=row;
@@ -51,5 +52,6 @@ sync_slave_with_master;
# that there is no bad timing cauing it to try to access the table.
connection master;
+SET @@global.event_scheduler= @old_event_scheduler;
DROP TABLE t28953;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt
deleted file mode 100644
index 1338b6eba04..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
- --innodb
diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
index 274599857be..bf71ffbfd1e 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
@@ -124,9 +124,11 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id
sync_slave_with_master;
connection master;
-# Parameter for include/wait_for_slave_sql_error_and_skip.inc, ask it
-# to show SQL error message
-let show_sql_error=1;
+# Parameters for include/wait_for_slave_sql_error_and_skip.inc:
+# Ask it to show SQL error message.
+let $show_sql_error= 1;
+# The expected error will always be 1146 (ER_NO_SUCH_TABLE).
+let $slave_sql_errno= 1146;
#
# Only do tables are referenced for update, these statements should
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
index a4d1d403dc9..95bca94fd3a 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
@@ -1 +1 @@
--O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/master-data/relay-log
+-O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.1/data/relay-log
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
index 95839c831c9..e2aa63225a3 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
@@ -1 +1 @@
--O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/slave-data/relay-log
+-O max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.2/data/relay-log
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index caead008169..a8befe612c2 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -2,7 +2,8 @@
# in case of bi-directional replication
-- source include/master-slave.inc
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
show variables like 'relay_log%';
connection slave;
@@ -24,13 +25,8 @@ stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
-start slave;
-#
-# Wait for start of slave IO and SQL threads
-#
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
+source include/start_slave.inc;
#
# Flush logs of slave
@@ -73,3 +69,9 @@ source include/wait_for_slave_param.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
--query_vertical SHOW SLAVE STATUS
+
+--disable_query_log
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+--enable_query_log
diff --git a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency-master.opt b/mysql-test/suite/rpl/t/rpl_idempotency-master.opt
deleted file mode 100644
index 66f581b56d0..00000000000
--- a/mysql-test/suite/rpl/t/rpl_idempotency-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---innodb
-
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt b/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
index 71ccf047474..03fc19ca6ae 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
@@ -1,2 +1 @@
---slave-exec-mode=IDEMPOTENT --innodb
-
+--slave-exec-mode=IDEMPOTENT
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test
index cec91a6f4b7..1946aa100ab 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test
@@ -7,6 +7,12 @@ source include/have_innodb.inc;
connection slave;
source include/have_innodb.inc;
+# Add suppression for expected warning(s) in slaves error log
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
+
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
@@ -203,9 +209,8 @@ select * from ti1 order by b /* must be (2),(3) */;
# foreign key: row is referenced
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -236,11 +241,10 @@ delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
---echo *** slave must stop
-
-source include/wait_for_slave_sql_to_stop.inc;
+--echo *** slave must stop
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -278,9 +282,8 @@ connection master;
insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -314,9 +317,8 @@ connection master;
DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -333,9 +335,8 @@ set global slave_exec_mode='STRICT';
connection master;
DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -356,9 +357,8 @@ connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -377,9 +377,8 @@ connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -391,8 +390,7 @@ start slave sql_thread;
connection master;
sync_slave_with_master;
#connection slave;
-set global slave_exec_mode='STRICT';
-
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
# cleanup for bug#31609 tests
@@ -400,16 +398,6 @@ connection master;
set @@session.binlog_format= @save_binlog_format;
drop table t1,t2,ti2,ti1;
-sync_slave_with_master;
-
+--source include/master-slave-end.inc
--echo *** end of tests
-
-
-
-
-
-
-
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index 7f13b16b0de..66f96e8f4e8 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
@@ -127,7 +127,8 @@ show grants for mysqltest4@localhost;
set global slave_exec_mode='IDEMPOTENT';
connection master;
-drop table t1, t4, mysqltest2.t2;
+drop table t1, mysqltest2.t2;
+drop table t4;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index e99b88899bf..38fcc116736 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -14,7 +14,7 @@ REPLACE INTO t1 VALUES (4);
SELECT * FROM t1;
connection slave;
---wait_for_slave_to_stop
+source include/wait_for_slave_sql_to_stop.inc;
# The 4 should not be inserted into the table, since the incident log
# event should have stop the slave.
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 1511bd541ed..58d1f6bdc01 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
@@ -7,33 +7,25 @@ source include/master-slave.inc;
set global max_connections=151;
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-start slave;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
connection master;
-save_master_pos;
-connection slave;
+sync_slave_with_master;
show variables like 'init_slave';
show variables like 'max_connections';
-sync_with_master;
reset master;
connection master;
show variables like 'init_slave';
show variables like 'max_connections';
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# Save variable value
set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1";
show variables like 'init_connect';
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
# Restore changed global variable
set global init_connect= @my_global_init_connect;
diff --git a/mysql-test/suite/rpl/t/rpl_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_innodb-master.opt
index 8636d2d8734..0eed7aaadad 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_innodb-master.opt
@@ -1 +1 @@
---innodb --innodb_autoinc_lock_mode=0
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb.test b/mysql-test/suite/rpl/t/rpl_innodb.test
index 30d40e19614..64a85d27c88 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb.test
@@ -18,7 +18,7 @@ CREATE TABLE t4 (
--disable_warnings
LOAD DATA
- INFILE '../std_data_ln/loaddata_pair.dat'
+ INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
--enable_warnings
@@ -30,7 +30,7 @@ SELECT * FROM t4;
connection master;
--disable_warnings
LOAD DATA
- INFILE '../std_data_ln/loaddata_pair.dat'
+ INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
(name,number);
--enable_warnings
@@ -74,6 +74,17 @@ SET AUTOCOMMIT = 0;
sync_slave_with_master;
--echo -------- switch to slave --------
connection slave;
+
+# We want to verify that the following transactions are written to the
+# binlog, despite the transaction is rolled back. (The should be
+# written to the binlog since they contain non-transactional DROP
+# TEMPORARY TABLE). To see that, we use the auxiliary table t1, which
+# is transactional (InnoDB) on master and MyISAM on slave. t1 should
+# be transactional on master so that the insert into t1 does not cause
+# the transaction to be logged. Since t1 is non-transactional on
+# slave, the change will not be rolled back, so the inserted rows will
+# stay in t1 and we can verify that the transaction was replicated.
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
--echo -------- switch to master --------
@@ -100,8 +111,7 @@ connection slave;
SHOW CREATE TABLE mysqltest1.tmp;
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE mysqltest1.tmp2;
-# has two rows here : as the default is MyISAM and
-# it can't be rolled back by the master's ROLLBACK.
+# t1 has two rows here: the transaction not rolled back since t1 uses MyISAM
SELECT COUNT(*) FROM mysqltest1.t1;
FLUSH LOGS;
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
index 8636d2d8734..0eed7aaadad 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt
@@ -1 +1 @@
---innodb --innodb_autoinc_lock_mode=0
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
index 8636d2d8734..0eed7aaadad 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt
@@ -1 +1 @@
---innodb --innodb_autoinc_lock_mode=0
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt
deleted file mode 100644
index 8636d2d8734..00000000000
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb --innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test
deleted file mode 100644
index 56b2c7bc03d..00000000000
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test
+++ /dev/null
@@ -1,68 +0,0 @@
---source include/have_innodb.inc
---source include/have_partition.inc
---vertical_results
-let $engine_type= 'innodb';
-
-######## Creat Table Section #########
-use test;
-
-eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
- dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
- fkid MEDIUMINT, filler VARCHAR(255),
- PRIMARY KEY(id)) ENGINE=$engine_type
- PARTITION BY RANGE(id)
- SUBPARTITION BY hash(id) subpartitions 2
- (PARTITION pa3 values less than (42),
- PARTITION pa6 values less than (60),
- PARTITION pa7 values less than (70),
- PARTITION pa8 values less than (80),
- PARTITION pa9 values less than (90),
- PARTITION pa10 values less than (100),
- PARTITION pa11 values less than MAXVALUE);
-
-######## Create SPs, Functions, Views and Triggers Section ##############
-
-delimiter |;
-
-CREATE PROCEDURE test.proc_part()
-BEGIN
- DECLARE ins_count INT DEFAULT 1000;
- DECLARE del_count INT;
- DECLARE cur_user VARCHAR(255);
- DECLARE local_uuid VARCHAR(255);
- DECLARE local_time TIMESTAMP;
-
- SET local_time= NOW();
- SET cur_user= CURRENT_USER();
- SET local_uuid= UUID();
-
- WHILE ins_count > 0 DO
- INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
- ins_count,'Going to test MBR for MySQL');
- SET ins_count = ins_count - 1;
- END WHILE;
- SELECT MAX(id) FROM test.part_tbl INTO del_count;
- WHILE del_count > 0 DO
- DELETE FROM test.part_tbl WHERE id = del_count;
- select count(*) as internal_count, del_count -- these two lines are for
- FROM test.part_tbl; -- debug to show the problem
- SET del_count = del_count - 2;
- END WHILE;
-END|
-
-delimiter ;|
-
-############ Finish Setup Section ###################
-
-############ Test Section ###################
---horizontal_results
-
-CALL test.proc_part();
-
-select count(*) as Part from test.part_tbl;
-
-###### CLEAN UP SECTION ##############
-
-DROP PROCEDURE test.proc_part;
-DROP TABLE test.part_tbl;
-
diff --git a/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test
index 4dacd77c9ac..6fb9ec8fd72 100644
--- a/mysql-test/suite/rpl/t/rpl_insert.test
+++ b/mysql-test/suite/rpl/t/rpl_insert.test
@@ -13,6 +13,9 @@ USE mysqlslap;
CREATE TABLE t1 (id INT, name VARCHAR(64)) ENGINE=MyISAM;
+sync_slave_with_master;
+connection master;
+
let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With Love'), (3, 'Goldfinger'), (4, 'Thunderball'), (5, 'You Only Live Twice')";
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";"
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_load_from_master.test b/mysql-test/suite/rpl/t/rpl_load_from_master.test
index b04d8a44226..0f085457817 100644
--- a/mysql-test/suite/rpl/t/rpl_load_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_from_master.test
@@ -144,10 +144,11 @@ select * from mysqltest.t1;
# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX
# insert into mysqltest.t1 values(10, 'should be there');
# flush tables;
-# system chmod 500 $MYSQLTEST_VARDIR/slave-data/mysqltest/;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+# system chmod 500 $MYSQLD_SLAVE_DATADIR/mysqltest/;
# --error 6
# load data from master; # should fail (errno 13)
-# system chmod 700 $MYSQLTEST_VARDIR/slave-data/mysqltest/;
+# system chmod 700 $MYSQLD_SLAVE_DATADIR/mysqltest/;
# select * from mysqltest.t1; # should contain the row (10, ...)
diff --git a/mysql-test/suite/rpl/t/rpl_load_table_from_master.test b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
index b9cec3858a9..aad113878d3 100644
--- a/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
@@ -71,9 +71,9 @@ sync_with_master;
connection master;
set SQL_LOG_BIN=0;
create table t1 (word char(20) not null, index(word))ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t1;
+load data infile '../../std_data/words.dat' into table t1;
create table t2 (word char(20) not null)ENGINE=MyISAM;
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key)ENGINE=MyISAM;
connection slave;
load table t1 from master;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
index 7f2389cb9f6..c191d29d5a3 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
@@ -9,17 +9,17 @@ source include/master-slave.inc;
#
connection master;
create table t1 (a varchar(10) character set utf8);
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
-load data infile '../std_data_ln/loaddata6.dat' into table t1;
+load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=DEFAULT;
-load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r;
+load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
index dceee7a65af..b7d9995c834 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
@@ -13,7 +13,7 @@ source include/show_slave_status.inc;
# Now we feed it a load data infile, which should make it stop with a
# fatal error.
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;
connection slave;
wait_for_slave_to_stop;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 537d4c163ef..42c3ad99f33 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
@@ -17,14 +17,14 @@ connection master;
# 'test' database should be ignored by the slave
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE test.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1;
SELECT COUNT(*) FROM test.t1;
# 'mysqltest' database should NOT be ignored by the slave
CREATE DATABASE mysqltest;
USE mysqltest;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
-LOAD DATA INFILE '../std_data_ln/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
+LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
SELECT COUNT(*) FROM mysqltest.t1;
# Now lets check the slave to see what we have :-)
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
index f397d741310..2dd2218eb5c 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
@@ -12,7 +12,7 @@ reset master;
connection master;
# 'test' is the current database
create table test.t1(a int, b int, unique(b));
-load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
+load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
# Test logging on slave;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
index 9e908cac677..439c2b48ca5 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
@@ -1,7 +1,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;
SELECT * FROM t1 ORDER BY word;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index b10603e7195..0de402f301a 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -19,13 +19,14 @@ while ($1)
}
set SQL_LOG_BIN=1;
enable_query_log;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
#This will generate a 20KB file, now test LOAD DATA LOCAL
truncate table t1;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
save_master_pos;
connection slave;
sync_with_master;
@@ -46,13 +47,13 @@ sync_with_master;
connection master;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval select * into outfile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' from t1;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
SELECT * FROM t1 ORDER BY a;
save_master_pos;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index 532db77c248..5aa4da41fe5 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -24,12 +24,12 @@ DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
INSERT INTO test.t1 VALUES(1,'test');
-UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=1;
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
delimiter |;
create procedure test.p1()
begin
INSERT INTO test.t1 VALUES(2,'test');
- UPDATE test.t1 SET blob_column=LOAD_FILE('../std_data_ln/words2.dat') WHERE a=2;
+ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
end|
delimiter ;|
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index 45a097b6f14..5e8390f97ed 100644
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -13,20 +13,14 @@
source include/master-slave.inc;
source include/show_master_status.inc;
sync_slave_with_master;
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/stop_slave.inc;
change master to master_log_pos=75;
source include/show_slave_status2.inc;
start slave;
-let $slave_param= Slave_SQL_Running;
-let $slave_param_value= Yes;
---source include/wait_for_slave_param.inc
-let $slave_param= Slave_IO_Running;
-let $slave_param_value= No;
---source include/wait_for_slave_param.inc
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/wait_for_slave_sql_to_start.inc;
+source include/wait_for_slave_io_to_stop.inc;
+source include/stop_slave.inc;
source include/show_slave_status.inc;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test
index 4a47e9645f9..d2e61d579e3 100644
--- a/mysql-test/suite/rpl/t/rpl_misc_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test
@@ -21,11 +21,12 @@ insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
# "altogether now"
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
sync_slave_with_master;
-create table t2 like t1;
+create temporary table t2 like t1;
# read the values from the master table
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval load data local infile '$MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
# compare them with the replica; the SELECT below should return no row
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
@@ -81,12 +82,12 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf());
--sync_slave_with_master
# Dump table on slave
-select * from t1 into outfile "../tmp/t1_slave.txt";
+select * from t1 into outfile "../../tmp/t1_slave.txt";
# Load data from slave into temp table on master
connection master;
create temporary table t1_slave select * from t1 where 1=0;
-load data infile '../tmp/t1_slave.txt' into table t1_slave;
+load data infile '../../tmp/t1_slave.txt' into table t1_slave;
--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
# Compare master and slave temp table, use subtraction
@@ -109,7 +110,7 @@ DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
---remove_file $MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile
+--remove_file $MYSQLD_DATADIR/test/rpl_misc_functions.outfile
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index 10780c765f7..31c4a2050d7 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
@@ -12,16 +12,14 @@ connection slave;
connection master;
-- source include/have_innodb.inc
--disable_warnings
-create database if not exists mysqltest1;
-use mysqltest1;
drop table if exists t1;
+--enable_warnings
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
sync_slave_with_master;
-use mysqltest1;
# MyISAM to MyISAM then InnoDB then MEMORY
@@ -101,8 +99,6 @@ show create table t1;
# cleanup
connection master;
DROP TABLE t1;
-# Need to drop mysqltest1 as well so other test will pass.
-DROP DATABASE mysqltest1;
sync_slave_with_master;
# End of 5.1 test case
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 1bde61aef78..79cb2d9d735 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -13,15 +13,15 @@ enable_warnings;
eval create database $db;
connection master;
+let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
+let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
# Restart slave for setting to take effect
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
@@ -65,26 +65,35 @@ SET @@global.net_buffer_length=4096;
# Restart slave for new setting to take effect
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
connect (master, localhost, root);
connection master;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
# The slave I/O thread must stop after trying to read the above event
connection slave;
---source include/wait_for_slave_io_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# import is only the 11th column Slave_IO_Running
---replace_column 1 # 7 # 8 # 9 # 12 # 22 # 23 # 33 #
-query_vertical show slave status;
+--source include/wait_for_slave_io_to_stop.inc
+let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+--echo Slave_IO_Running = $slave_io_running (expect No)
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
+eval SET @@global.net_buffer_length= $old_net_buffer_length;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index 27f1ac3348d..b00dec6b80c 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -123,7 +123,7 @@ DROP DATABASE mysqltest1;
--echo
use test;
-
+DROP TABLE t1;
--echo
--save_master_pos
diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
index 72ae6a99c44..8863c9d4ac7 100644
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -5,6 +5,8 @@
# Test that the slave temporarily switches to ROW when seeing binrow
# events when it is in STATEMENT or MIXED mode
+SET @old_binlog_format= @@global.binlog_format;
+
SET BINLOG_FORMAT=MIXED;
SET GLOBAL BINLOG_FORMAT=MIXED;
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
@@ -33,6 +35,7 @@ SHOW BINLOG EVENTS;
connection master;
DROP TABLE IF EXISTS t1;
+SET @@global.binlog_format= @old_binlog_format;
# Let's compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed and not reject file
diff --git a/mysql-test/suite/rpl/t/rpl_read_only-slave.opt b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
index cf4319f2b40..e5b24dd9413 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
@@ -1,3 +1,2 @@
-O max_relay_log_size=16384
---loose-innodb
--log-warnings
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
index 90f00764691..fea168ee9f1 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
@@ -11,7 +11,7 @@ create table t2 (n int);
insert into t2 values(4);
connection master;
create table t2 (s char(20));
-load data infile '../std_data_ln/words.dat' into table t2;
+load data infile '../../std_data/words.dat' into table t2;
insert into t2 values('five');
create table t1 (m int);
insert into t1 values(15),(16),(17);
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 52f04e073dd..4dfe2edaf35 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
@@ -34,8 +34,8 @@ create database rewrite;
connection master;
use test;
create table t1 (a date, b date, c date not null, d date);
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',';
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
sync_slave_with_master;
connection slave;
@@ -43,7 +43,7 @@ select * from rewrite.t1;
connection master;
truncate table t1;
-load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
sync_slave_with_master;
connection slave;
@@ -52,7 +52,7 @@ select * from rewrite.t1;
connection master;
drop table t1;
create table t1 (a text, b text);
-load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
sync_slave_with_master;
connection slave;
@@ -61,7 +61,7 @@ select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
connection master;
drop table t1;
create table t1 (a int, b char(10));
-load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
sync_slave_with_master;
connection slave;
@@ -69,7 +69,7 @@ select * from rewrite.t1;
connection master;
truncate table t1;
-load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
sync_slave_with_master;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
deleted file mode 100644
index ad2c6a647b5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
+++ /dev/null
@@ -1 +0,0 @@
--O max_binlog_size=4096
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
index 80190bf6d29..80190bf6d29 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf b/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf
new file mode 100644
index 00000000000..7e676dc2da8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf
@@ -0,0 +1,6 @@
+!include ../rpl_1slave_base.cnf
+
+[mysqld.1]
+max_binlog_size=4096
+
+
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index 9133c429934..2bad7b27272 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -23,9 +23,10 @@ drop table if exists t1, t2, t3, t4;
--enable_warnings
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
# Create empty file
-write_file $MYSQLTEST_VARDIR/slave-data/master.info;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+write_file $MYSQLD_SLAVE_DATADIR/master.info;
EOF
-chmod 0000 $MYSQLTEST_VARDIR/slave-data/master.info;
+chmod 0000 $MYSQLD_SLAVE_DATADIR/master.info;
connection slave;
--disable_warnings
drop table if exists t1, t2, t3, t4;
@@ -36,7 +37,7 @@ drop table if exists t1, t2, t3, t4;
--replace_result $MYSQL_TEST_DIR TESTDIR
--error 1105,1105,29
start slave;
-chmod 0600 $MYSQLTEST_VARDIR/slave-data/master.info;
+chmod 0600 $MYSQLD_SLAVE_DATADIR/master.info;
# It will fail again because the file is empty so the slave cannot get valuable
# info about how to connect to the master from it (failure in
# init_strvar_from_file() in init_master_info()).
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
index ed7656c1f99..de86b63f230 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
@@ -1,2 +1,2 @@
---binlog_ignore_db=test_ignore --loose-innodb
+--binlog_ignore_db=test_ignore
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
new file mode 100644
index 00000000000..59757e2e802
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
@@ -0,0 +1,31 @@
+# See the top of mysql-test/extra/rpl_tests/rpl_conflicts.test for
+# explanation of what this test does.
+#
+# This test file is for row-logging mode. It runs the test twice, with
+# slave_exec_mode=STRICT and slave_exec_mode=IDEMPOTENT, respectively.
+
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+connection slave;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
+
+--echo [on slave]
+connection slave;
+SET @old_slave_exec_mode= @@global.slave_exec_mode;
+
+
+--echo ######## Run with slave_exec_mode=STRICT ########
+
+SET @@global.slave_exec_mode = 'STRICT';
+source extra/rpl_tests/rpl_conflicts.test;
+
+
+--echo ######## Run with slave_exec_mode=IDEMPOTENT ########
+
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+source extra/rpl_tests/rpl_conflicts.test;
+
+
+SET @@global.slave_exec_mode= @old_slave_exec_mode;
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index 3fb5aa8e1f2..319f9546a81 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -29,6 +29,8 @@ SET GLOBAL storage_engine=memory;
START SLAVE;
--enable_query_log
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
@@ -36,7 +38,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---query_vertical SHOW BINLOG EVENTS FROM 216
+--query_vertical SHOW BINLOG EVENTS FROM 106
--echo **** On Master ****
--query_vertical SHOW CREATE TABLE t1
--query_vertical SHOW CREATE TABLE t2
@@ -65,6 +67,8 @@ SELECT * FROM t5 ORDER BY a,b,c;
--query_vertical SHOW CREATE TABLE t6
SELECT * FROM t6 ORDER BY a,b,c;
+--source include/reset_master_and_slave.inc
+
connection master;
# Test for erroneous constructions
--error ER_DUP_ENTRY
@@ -72,7 +76,7 @@ CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
# Shouldn't be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
# Test that INSERT-SELECT works the same way as for SBR.
CREATE TABLE t7 (a INT, b INT UNIQUE);
@@ -82,10 +86,12 @@ SELECT * FROM t7 ORDER BY a,b;
# Should be written to the binary log
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1374;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
@@ -94,11 +100,13 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1711;
+SHOW BINLOG EVENTS FROM 106;
SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
+--source include/reset_master_and_slave.inc
+
connection master;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
@@ -110,7 +118,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
--query_vertical SHOW CREATE TABLE t9
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1946;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
--echo **** On Slave ****
--query_vertical SHOW CREATE TABLE t8
@@ -162,7 +170,7 @@ SELECT * FROM t3 ORDER BY a;
SELECT * FROM t4 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SHOW TABLES;
SELECT TABLE_NAME,ENGINE
@@ -208,13 +216,17 @@ COMMIT;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
connection master;
TRUNCATE TABLE t2;
+sync_slave_with_master;
+--source include/reset_master_and_slave.inc
+
+connection master;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -227,7 +239,7 @@ ROLLBACK;
SELECT * FROM t2 ORDER BY a;
--replace_column 1 # 4 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 949;
+SHOW BINLOG EVENTS FROM 106;
sync_slave_with_master;
SELECT * FROM t2 ORDER BY a;
@@ -266,6 +278,9 @@ sync_slave_with_master;
source include/master-slave-reset.inc;
connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
CREATE DATABASE mysqltest1;
CREATE TABLE mysqltest1.without_select (f1 BIGINT);
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
deleted file mode 100644
index abd717f8222..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-ignore-table=test.t2
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
index 25a8c0e744e..0c038c41ebf 100644
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -1,33 +1,42 @@
-# Test to see what slave says when master is updating a table it does
-# not have
+# ==== Purpose ====
+#
+# Verify that slave gives an error message if master updates a table
+# that slave does not have.
+#
+# ==== Method ====
+#
+# Create a table on master, wait till it's on slave, remove it from
+# slave. Then update the table on master.
+
--source include/have_binlog_format_row.inc
source include/master-slave.inc;
-connection master;
-create table t1 (a int not null primary key);
-insert into t1 values (1);
-create table t2 (a int);
-insert into t2 values (1);
-update t1, t2 set t1.a = 0 where t1.a = t2.a;
+--echo ==== Setup table on master but not on slave ====
+--echo [on master]
+CREATE TABLE t1 (a INT);
+--echo [on slave]
sync_slave_with_master;
-# t2 should not have been replicated
-# t1 should have been properly updated
-show tables;
-select * from t1;
-drop table t1;
+DROP TABLE t1;
+--echo ==== Modify table on master ====
+--echo [on master]
connection master;
-insert into t1 values (1);
+INSERT INTO t1 VALUES (1);
+--echo ==== Verify error on slave ====
+--echo [on slave]
connection slave;
# slave should have stopped because can't find table t1
--source include/wait_for_slave_sql_to_stop.inc
# see if we have a good error message:
---replace_column 7 #
-source include/show_slave_status.inc;
+let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+--echo Last_SQL_Error = $err
+
+--echo ==== Clean up ====
+source include/stop_slave.inc;
-# cleanup
+--echo [on master]
connection master;
-drop table t1, t2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
index a0be59e44a7..ea4b958ae4c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
@@ -4,8 +4,7 @@
# Test of manual relay log rotation with FLUSH LOGS.
# Requires statement logging
--- source include/not_ndb_default.inc
-SET SESSION BINLOG_FORMAT=ROW;
-SET GLOBAL BINLOG_FORMAT=ROW;
--- source extra/rpl_tests/rpl_max_relay_size.test
+source include/not_ndb_default.inc;
+source include/have_binlog_format_row.inc;
+source extra/rpl_tests/rpl_max_relay_size.test;
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index 192c1e325bf..62b46eeb58e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -37,11 +37,11 @@ CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT,
--disable_query_log
INSERT INTO t1 VALUES ("abirvalg");
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
-LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
# d1 length 3000
set @d1 = 'dd1';
@@ -96,10 +96,10 @@ select "--- Test 1 Dump binlog to file --" as "";
#
# Prepare local temporary file to recreate what we have currently.
+let $MYSQLD_DATADIR= `select @@datadir;`;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
-
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
# Now that we have our file, lets get rid of the current database.
# Cleanup the master and the slave and try to recreate.
@@ -160,7 +160,7 @@ connection master;
# We should be gold by the time, so I will get rid of our file.
---exec rm $MYSQLTEST_VARDIR/tmp/master.sql
+remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
# this test for position option
@@ -168,8 +168,9 @@ connection master;
--disable_query_log
select "--- Test 2 position test --" as "";
--enable_query_log
+let $MYSQLD_DATADIR= `select @@datadir;`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLD_DATADIR/master-bin.000001
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -263,14 +264,15 @@ select "--- Test 5 LOAD DATA --" as "";
--disable_query_log
select "--- Test 6 reading stdin --" as "";
--enable_query_log
+let $MYSQLD_DATADIR= `select @@datadir;`;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --stop-position=569 - < $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
--disable_query_log
select "--- Test 7 reading stdin w/position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
# Bug#16217 (mysql client did not know how not switch its internal charset)
--disable_query_log
@@ -299,9 +301,10 @@ create table t4 (f text character set utf8);
create table t5 (f text character set cp932);
--exec $MYSQL --default-character-set=utf8 test -e "insert into t4 values(_utf8'ソ')"
--exec $MYSQL --default-character-set=cp932 test -e "insert into t5 values(_cp932'ƒ\');"
+let $MYSQLD_DATADIR= `select @@datadir;`;
flush logs;
rename table t4 to t04, t5 to t05;
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 | $MYSQL --default-character-set=utf8
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL --default-character-set=utf8
# original and recovered data must be equal
select HEX(f) from t04;
select HEX(f) from t4;
@@ -337,10 +340,12 @@ INSERT INTO t1 VALUES(1,1);
SELECT * FROM t1;
+let $MYSQLD_DATADIR= `select @@datadir;`;
+
FLUSH LOGS;
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/local.sql
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/local.sql
--diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql
diff --git a/mysql-test/suite/rpl/t/rpl_row_mystery22.test b/mysql-test/suite/rpl/t/rpl_row_mystery22.test
deleted file mode 100644
index a3ba8648b22..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_mystery22.test
+++ /dev/null
@@ -1,52 +0,0 @@
-# Originally taken from rpl_mystery22.test,
-# but this row-based-replication test has a totally different spirit:
-# slave will not stop because of dup key,
-# instead we test if it does overwrite the dup key
-# as expected.
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
-# first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key, s char(10));
-sync_slave_with_master;
-
-# bug#31552/31609 idempotency is not default any longer
-# so that the declared in heading comments aim of the test
-# should be backed up with explicit setting of the slave mode
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-
-insert into t1 values (2,'old');
-connection master;
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1 order by n;
-delete from t1 where n = 2;
---disable_warnings
-start slave;
---enable_warnings
-sync_with_master;
-stop slave;
-connection master;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-# what happens when we delete a row which does not exist on slave?
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-save_master_pos;
-connection slave;
---disable_warnings
-start slave;
---enable_warnings
-sync_with_master;
-select * from t1 order by n;
-#clean up
-connection master;
-drop table t1;
-sync_slave_with_master;
-set @@global.slave_exec_mode= default;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index b118242dc3b..f5a74325b7c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
@@ -84,6 +84,7 @@ let $message=< ---- Master selects-- >;
--source include/show_msg.inc
connection master;
CALL test.p1();
+
let $wait_condition= SELECT COUNT(*) = 4 FROM t3;
--source include/wait_condition.inc
save_master_pos;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
index 29b3008e822..9b24c78e62d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
@@ -9,18 +9,18 @@
connection master;
create table t1 (words varchar(20)) engine=myisam;
-load data infile '../std_data_ln/words.dat' into table t1 (words);
+load data infile '../../std_data/words.dat' into table t1 (words);
select count(*) from t1;
save_master_pos;
connection slave;
-# slave will automatically tell itself to stop thanks to the .opt
+# slave will automatically stop the sql thread thanks to the .opt
# file; it will initiate the stop request after the first
# Rows_log_event (out of 3) but should wait until the last one is
# executed before stopping.
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
# check that we inserted all rows (waited until the last Rows event)
select count(*) from t1;
@@ -28,4 +28,5 @@ select count(*) from t1;
connection master;
drop table t1;
connection slave; # slave SQL thread is stopped
+source include/stop_slave.inc;
drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index bdf7351d9a5..d89de7d9ebd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -9,12 +9,8 @@ let $VERSION=`select version()`;
# stop slave before he will start replication also sync with master
# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+sync_slave_with_master;
+--source include/stop_slave.inc
connection master;
# create some events on master
@@ -53,12 +49,13 @@ connection master;
save_master_pos;
connection slave;
sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--source include/stop_slave.inc
# this should stop immediately as we are already there
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
+start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
+--let $slave_param= Until_Log_Pos
+--let $slave_param_value= 740
+--source include/wait_for_slave_param.inc
--source include/wait_for_slave_sql_to_stop.inc
# here the sql slave thread should be stopped
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
@@ -76,5 +73,5 @@ start slave until relay_log_file='slave-relay-bin.000002';
--error 1277
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
# Warning should be given for second command
-start slave sql_thread;
+start slave;
start slave until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
index a0467d93543..c97f7975278 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id1.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
@@ -9,7 +9,7 @@ connection slave;
reset master;
# replicate ourselves
-stop slave;
+source include/stop_slave.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
start slave;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
index 7e67fb42b4f..488a3aa6ab6 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id2.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
@@ -9,9 +9,6 @@ reset master;
stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 18 # 35 # 36 #
-query_vertical show slave status;
start slave;
insert into t1 values (1);
save_master_pos;
@@ -23,4 +20,44 @@ select * from t1; # check that indeed 2 were inserted
stop slave;
drop table t1;
-# End of 4.1 tests
+
+#
+# Bug#38934 slave slave until does not work with --replicate-same-server-id
+#
+# Verifying that slave performs all events until the master_log_pos
+# in presense of --replicate-same-server-id the slave is started with.
+
+connection master;
+reset master;
+
+# setting the until position to correspond to the first following create table
+# which will make the event executed and the slave sql thread stopped
+# right after that.
+let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+inc $until_pos;
+
+create table t1(n int);
+create table t2(n int);
+
+connection slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_port=$MASTER_MYPORT;
+--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_io_to_start.inc
+--source include/wait_for_slave_sql_to_stop.inc
+
+--echo *** checking until postion execution: must be only t1 in the list ***
+show tables;
+
+# cleanup
+
+connection slave;
+start slave sql_thread;
+
+connection master;
+drop table t1;
+drop table t2;
+sync_slave_with_master;
+
+# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
new file mode 100644
index 00000000000..1a0ff8d52f0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -0,0 +1,176 @@
+#############################################################
+# Author: Serge Kozlov <skozlov@mysql.com>
+# Date: 03/21/2008
+# Purpose:
+# WL#3734 Test: slave group execution
+# Testing slave group execution: stop in middle of the group
+# (of events) should be immpossible on slave.
+# Group of events means set of statements between BEGIN/COMMIT
+# for transactional engines or a statement for
+# non-transactional engines that fires triggers and
+# affects to another tables.
+# Implementation of slave stop in middle of the group:
+# Delete the table on slave before start of the group
+# on master where this table is participant of the group.
+# So sql thread will failed inside of the group.
+# Expected results:
+# 1. For non-transactional engines w/o PK slave should trying
+# to complete executing of the group.
+# 2. For non-transactional engines slave should stop on
+# start position of the group.
+#############################################################
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--echo
+
+# Create tables and data
+--echo *** Preparing data ***
+--connection master
+CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+
+DELIMITER |;
+CREATE TRIGGER tr1 BEFORE UPDATE ON t1
+ FOR EACH ROW BEGIN
+ UPDATE t2 SET b='YY' WHERE a=NEW.a;
+ END|
+CREATE TRIGGER tr2 AFTER UPDATE ON t1
+ FOR EACH ROW BEGIN
+ UPDATE t3 SET b='ZZ' WHERE a=NEW.a;
+ END|
+DELIMITER ;|
+--echo
+
+# Test non-transactional group with MyISAM tables w/o PK.
+# Data for t1,t2 should be replicated for SBR even t3
+# doesn't exist on slave
+--echo *** Test non-transactional group w/o PK ***
+
+--connection master
+INSERT INTO t3 VALUES(1, 'AA');
+INSERT INTO t2 VALUES(1, 'AA');
+INSERT INTO t1 VALUES(1, 'AA');
+--sync_slave_with_master
+
+RENAME TABLE t3 TO t3_bak;
+
+--connection master
+UPDATE t1 SET b = 'XX' WHERE a = 1;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+SHOW TABLES LIKE 't%';
+if (`SELECT @@BINLOG_FORMAT = 'ROW'`) {
+--replace_regex /AA/AA_for_row_or_XX_for_stmt_mixed/
+ SELECT * FROM t1 ORDER BY a;
+--replace_regex /AA/AA_for_row_or_YY_for_stmt_mixed/
+ SELECT * FROM t2 ORDER BY a;
+}
+if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
+--replace_regex /XX/AA_for_row_or_XX_for_stmt_mixed/
+ SELECT * FROM t1 ORDER BY a;
+--replace_regex /YY/AA_for_row_or_YY_for_stmt_mixed/
+ SELECT * FROM t2 ORDER BY a;
+}
+
+--source include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+--source include/start_slave.inc
+
+--connection master
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+--sync_slave_with_master
+--echo
+
+
+# Test non-transactional group with MyISAM tables and PK.
+# No data replicated because update based on PK
+--echo *** Test non-transactional group w/ PK ***
+
+--connection master
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+ALTER TABLE t2 ADD PRIMARY KEY (a);
+ALTER TABLE t3 ADD PRIMARY KEY (a);
+--sync_slave_with_master
+RENAME TABLE t3 TO t3_bak;
+
+--connection master
+INSERT INTO t3 VALUES(2, 'B');
+INSERT INTO t2 VALUES(2, 'B');
+INSERT INTO t1 VALUES(2, 'B');
+UPDATE t1 SET b = 'X' WHERE a = 2;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+
+--connection master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--connection slave
+SHOW TABLES LIKE 't%';
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--source include/stop_slave.inc
+RENAME TABLE t3_bak TO t3;
+--source include/start_slave.inc
+
+--connection master
+TRUNCATE t1;
+TRUNCATE t2;
+TRUNCATE t3;
+--sync_slave_with_master
+--echo
+
+
+# Test transactional group with InnoDB tables with PK
+# No data replicated if errors happens inside transaction
+--echo *** Test transactional group w/ PK ***
+
+--connection master
+ALTER TABLE t1 ENGINE=InnoDB;
+ALTER TABLE t2 ENGINE=InnoDB;
+ALTER TABLE t3 ENGINE=InnoDB;
+
+--connection slave
+RENAME TABLE t3 TO t3_bak;
+
+--connection master
+BEGIN;
+INSERT INTO t1 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t2 VALUES (3, 'C'), (4, 'D');
+INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
+COMMIT;
+
+--connection slave
+--source include/wait_for_slave_sql_to_stop.inc
+
+--connection master
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+SELECT * FROM t3 ORDER BY a;
+
+--connection slave
+SHOW TABLES LIKE 't%';
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+source include/stop_slave.inc;
+RENAME TABLE t3_bak TO t3;
+source include/start_slave.inc;
+
+# Clean up
+--echo *** Clean up ***
+--connection master
+DROP TABLE t1,t2,t3;
+--sync_slave_with_master
+
+# End of 5.1 test
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt
deleted file mode 100644
index 627becdbfb5..00000000000
--- a/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 8a5b1ae0ae4..f4cb0f69e93 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -110,8 +110,7 @@ DELIMITER ;|
--echo **** On Slave ****
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo **** On Master ****
connection master;
@@ -121,6 +120,7 @@ DROP TRIGGER tr2;
INSERT INTO t1 VALUES (3,'master/slave');
INSERT INTO t2 VALUES (3,'master/slave');
INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
@@ -131,8 +131,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t1 ORDER BY a;
@@ -156,8 +155,7 @@ CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
--echo **** On Slave ****
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -182,8 +180,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -194,8 +191,7 @@ SELECT * FROM t6 ORDER BY a;
--echo **** On Slave ****
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -220,8 +216,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -232,8 +227,7 @@ SELECT * FROM t6 ORDER BY a;
# And the same, but with autocommit = 0
#
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
connection master;
SET AUTOCOMMIT=0;
@@ -257,8 +251,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -280,16 +273,14 @@ CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
--echo *** On Slave ***
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
SET SESSION BINLOG_FORMAT=STATEMENT;
-exec cp ./suite/rpl/data/rpl_bug28618.dat $MYSQLTEST_VARDIR/tmp/;
+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
-remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat;
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
@@ -298,8 +289,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t10 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index 46836382ac4..4edf1802a5d 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -23,39 +23,36 @@
--echo ==== Create new replication user ====
--echo [on master]
connection master;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
--echo [on slave]
sync_slave_with_master;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-change master to master_user='rpl',master_password='rpl';
-start slave;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+CHANGE MASTER TO master_user='rpl', master_password='rpl';
+source include/start_slave.inc;
--echo ==== Do replication as new user ====
--echo [on master]
connection master;
-create table t1 (n int);
-insert into t1 values (1);
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES (1);
--echo [on slave]
sync_slave_with_master;
-select * from t1;
+SELECT * FROM t1;
--echo ==== Delete new replication user ====
--echo [on master]
connection master;
-drop user rpl@127.0.0.1;
-flush privileges;
+DROP USER rpl@127.0.0.1;
+FLUSH PRIVILEGES;
--echo [on slave]
sync_slave_with_master;
--echo ==== Restart slave without privileges =====
# (slave.err will contain access denied error for this START SLAVE command)
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-start slave;
+source include/stop_slave.inc;
+START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
--echo ==== Verify that Slave_IO_Running = No ====
@@ -63,11 +60,10 @@ let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
--echo Slave_IO_Running = $result (should be No)
--echo ==== Cleanup (Note that slave IO thread is not running) ====
-drop table t1;
-delete from mysql.user where user='rpl';
+DROP TABLE t1;
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
--echo [on master]
connection master;
-drop table t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index acf50d59b85..ec6464fb095 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -11,6 +11,7 @@
source include/have_binlog_format_mixed.inc;
source include/master-slave.inc;
+
# we need a db != test, where we don't have automatic grants
--disable_warnings
drop database if exists mysqltest1;
@@ -240,6 +241,8 @@ begin
end|
delimiter ;|
connection master;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
# test old variable name:
set global log_bin_trust_routine_creators=1;
# now use new name:
@@ -247,6 +250,8 @@ set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
# slave needs it too otherwise will not execute what master allowed:
connection slave;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
connection con1;
@@ -571,9 +576,12 @@ show binlog events in 'master-bin.000001' from 106;
# Restore log_bin_trust_function_creators to its original value.
# This is a cleanup for all parts above where we tested stored
# functions and triggers.
-set global log_bin_trust_function_creators=0;
+connection slave;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
connection master;
-set global log_bin_trust_function_creators=0;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# Clean up
drop database mysqltest;
@@ -625,8 +633,9 @@ show function status like '%mysqltestbug36570%';
connection master;
flush logs;
+let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex s/$MYSQL_TEST_DIR/MYSQL_TEST_DIR/ s/TIMESTAMP=[0-9]*/TIMESTAMP=t/
---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001
use test;
drop procedure mysqltestbug36570_p1;
drop procedure ` mysqltestbug36570_p2`;
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index c1092e3260f..63ac3a8ad9c 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -10,6 +10,8 @@
# ****************************************************************
connection master;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
+
# cleanup
--disable_warnings
drop procedure if exists p1;
@@ -254,8 +256,8 @@ drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
-sync_slave_with_master;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
-SET GLOBAL log_bin_trust_function_creators = 0;
+sync_slave_with_master;
--echo end of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
index 93c613f4cf4..dbf0775c978 100644
--- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
@@ -25,6 +25,7 @@ let $wait_condition= SELECT COUNT(*) > 0 FROM t1;
source include/wait_condition.inc;
stop slave io_thread;
start slave io_thread;
+source include/wait_for_slave_to_start.inc;
sync_with_master;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
new file mode 100644
index 00000000000..07b7a0bf8f7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
@@ -0,0 +1,11 @@
+# See the top of mysql-test/extra/rpl_tests/rpl_conflicts.test for an
+# explanation of what this test does.
+#
+# This test file is for statement-logging mode.
+
+source include/have_binlog_format_mixed_or_statement.inc;
+source include/master-slave.inc;
+
+source extra/rpl_tests/rpl_conflicts.test;
+
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
deleted file mode 100644
index b43a734fffc..00000000000
--- a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
+++ /dev/null
@@ -1,66 +0,0 @@
-################################
-# Change Author: JBM
-# Change Date: 2006-01-12
-# Change: Added back have stm binlog
-# and added requirments comments
-################################
-# test case to make slave thread get ahead by 22 bytes
-################################
-#REQUIREMENT: If there is a faked slave duplicate key insert
-#error and the slave is restarted, the replication should
-#proceed in a correct way.
-################################
-#REQUIREMENT: If there is a faked slave non-existing record
-#delete error and the slave is restarted, then the replication
-#should proceed in a correct way.
-#################################
-
--- source include/have_binlog_format_mixed_or_statement.inc
--- source include/master-slave.inc
-
-# first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key, s char(10));
-sync_slave_with_master;
-insert into t1 values (2,'old');
-connection master;
-insert into t1 values(NULL,'new');
-insert into t1 values(NULL,'new');
-save_master_pos;
-connection slave;
-# wait until the slave tries to run the query, fails and aborts slave thread
-source include/wait_for_slave_sql_error.inc;
-select * from t1 order by n;
-delete from t1 where n = 2;
---disable_warnings
-start slave;
---enable_warnings
-sync_with_master;
-#now the buggy slave would be confused on the offset but it can replicate
-#in order to make it break, we need to stop/start the slave one more time
-stop slave;
-connection master;
-# to be able to really confuse the slave, we need some non-auto-increment
-# events in the log
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL,'new');
-# what happens when we delete a row which does not exist on slave?
-set sql_log_bin=0;
-insert into t1 values(NULL,'new');
-set sql_log_bin=1;
-delete from t1 where n=4;
-save_master_pos;
-connection slave;
---disable_warnings
-start slave;
---enable_warnings
-#now the truth comes out - if the slave is buggy, it will never sync because
-#the slave thread is not able to read events
-sync_with_master;
-select * from t1 order by n;
-#clean up
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 2793e8833fd..07a3b27763d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -1,22 +1,37 @@
+# ==== Purpose ====
+#
+# Verify that START SLAVE UNTIL replicates until the given binlog
+# position but not longer. Verify that START SLAVE UNTIL with various
+# incorrect arguments gives an error.
+#
+# ==== Method ====
+#
+# On master, create a table and insert some rows. On slave, START
+# SLAVE UNTIL so that it reads one event at a time, and check the
+# table and the slave status each time.
+#
+# Then, on slave, run START SLAVE UNTIL with incorrect arguments and
+# verify that it gives an error.
+#
+# ==== Related bugs ====
+#
+# Bug in this test: BUG#37717: rpl.rpl_stm_until 'stmt' fails sporadically on pushbuild
+
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
# Test is dependent on binlog positions
-# prepare version for substitutions
-let $VERSION=`select version()`;
+# Stop slave before it starts replication. Also sync with master
+# to avoid nondeterministic behaviour.
+--echo [on slave]
+sync_slave_with_master;
+--source include/stop_slave.inc
-# stop slave before he will start replication also sync with master
-# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--echo ==== Create some events on master ====
+--echo [on master]
connection master;
-# create some events on master
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -25,9 +40,13 @@ insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
+--echo ==== Replicate one event at a time on slave ====
+
# try to replicate all queries until drop of t1
+--echo [on slave]
connection slave;
start slave until master_log_file='master-bin.000001', master_log_pos=323;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
# here table should be still not deleted
select * from t1;
@@ -35,6 +54,7 @@ source include/show_slave_status2.inc;
# this should fail right after start
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
# again this table should be still not deleted
select * from t1;
@@ -42,28 +62,28 @@ source include/show_slave_status2.inc;
# try replicate all up to and not including the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
select * from t2;
source include/show_slave_status2.inc;
# clean up
start slave;
+--echo [on master]
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--echo [on slave]
+sync_slave_with_master;
+--source include/stop_slave.inc
# this should stop immediately as we are already there
start slave until master_log_file='master-bin.000001', master_log_pos=776;
+--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
-# here the sql slave thread should be stopped
--replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
source include/show_slave_status2.inc;
-#testing various error conditions
+--echo ==== Test various error conditions ====
+
--error 1277
start slave until master_log_file='master-bin', master_log_pos=561;
--error 1277
@@ -78,4 +98,3 @@ 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;
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index a40d1cbb5c5..0bf3ecf97a2 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
@@ -16,6 +16,10 @@ source include/add_anonymous_users.inc;
# (otherwise RESET MASTER may come too early).
save_master_pos;
connection slave;
+
+# Add suppression for expected warning(s) in slaves error log
+call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
+
sync_with_master;
reset master;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
index f38ed29f7d4..3b373e00a62 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
@@ -1,5 +1,7 @@
source include/master-slave.inc;
+call mtr.add_suppression("Deadlock found");
+
--echo **** On Master ****
connection master;
SET SESSION BINLOG_FORMAT=ROW;
diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test
index dac21000a62..d65242f2a22 100644
--- a/mysql-test/suite/rpl/t/rpl_timezone.test
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test
@@ -67,7 +67,7 @@ connection master;
connection master;
delete from t1;
set time_zone='UTC';
-load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
+load data infile '../../std_data/rpl_timezone2.dat' into table t1;
SELECT * FROM t1 ORDER BY n;
sync_slave_with_master;
set time_zone='UTC';
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 911110d17dc..a3929458026 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -46,9 +46,7 @@ insert into t2 values(NULL,0),(500,0);
select a,b, truncate(rand_value,4) from t1;
select * from t2;
select a,name, old_a, old_b, truncate(rand_value,4) from t3;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
--disable_query_log
select "--- On slave --" as "";
--enable_query_log
@@ -108,9 +106,7 @@ SELECT trigger_name, definer
FROM information_schema.triggers
WHERE trigger_name = 't1_first';
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
--disable_query_log
select "--- On slave --" as "";
--enable_query_log
@@ -165,9 +161,7 @@ create database other;
use other;
insert into test.t1 values (1);
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
connection master;
use test;
@@ -265,6 +259,8 @@ while ($rnd)
connection master;
eval drop table t1$rnd;
+ sync_slave_with_master;
+ connection master;
dec $rnd;
}
@@ -300,8 +296,30 @@ STOP SLAVE;
# Replace master's binlog.
connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
FLUSH LOGS;
-exec cp $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLTEST_VARDIR/log/master-bin.000001;
+
+# Stop master server
+--echo --> Stop master server
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+# Replace binlog
+remove_file $MYSQLD_DATADIR/master-bin.000001;
+copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001;
+
+--echo --> Start master server
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1);
+
+# Make the slave to replay the new binlog.
+--echo --> Master binlog: $binlog_version
# Make the slave to replay the new binlog.
@@ -377,9 +395,7 @@ DROP TABLE IF EXISTS t2;
--echo
--echo ---> Synchronizing slave with master...
---save_master_pos
---connection slave
---sync_with_master
+--sync_slave_with_master
--echo
--echo ---> connection: master
@@ -411,9 +427,7 @@ SELECT * FROM t2;
--echo
--echo ---> Synchronizing slave with master...
---save_master_pos
---connection slave
---sync_with_master
+--sync_slave_with_master
--echo ---> connection: master
@@ -435,9 +449,7 @@ SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
---save_master_pos
---connection slave
---sync_with_master
+--sync_slave_with_master
--connection master
#
@@ -467,20 +479,49 @@ drop trigger if exists t1_bi;
insert into t1 values (3, "c");
select * from t1;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
+sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
+sync_slave_with_master;
#
-# End of tests
+# Bug#40116: Uncommited changes are replicated and stay on slave after
+# rollback on master
#
-save_master_pos;
+
+connection master;
+source include/master-slave-reset.inc;
+source include/have_innodb.inc;
connection slave;
-sync_with_master;
+source include/have_innodb.inc;
+
+connection master;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+ after insert on t1
+ for each row insert into log values ( new.f );
+
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+sync_slave_with_master;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+--source include/diff_tables.inc
+
+let $diff_table_1=master:test.log;
+let $diff_table_2=slave:test.log;
+--source include/diff_tables.inc
+
+connection master;
+drop table t1, log;
+sync_slave_with_master;
+
+#
+# End of tests
+#