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/include/rpl_mixed_ddl.inc3
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc3
-rw-r--r--mysql-test/suite/rpl/r/rpl000011.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_000010.result (renamed from mysql-test/suite/rpl/r/rpl000010.result)9
-rw-r--r--mysql-test/suite/rpl/r/rpl_000011.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_000013.result (renamed from mysql-test/suite/rpl/r/rpl000013.result)9
-rw-r--r--mysql-test/suite/rpl/r/rpl_000017.result (renamed from mysql-test/suite/rpl/r/rpl000017.result)10
-rw-r--r--mysql-test/suite/rpl/r/rpl_EE_err.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_11932.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result45
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result65
-rw-r--r--mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result37
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_corruption.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_errors.result278
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit_npk.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug31076.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug37426.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug38694.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug41902.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset_sjis.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result86
-rw-r--r--mysql-test/suite/rpl/r/rpl_colSize.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_commit_after_flush.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_concurrency_error.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_conditional_comments.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_database.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_if_not_exists.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_cross_version.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_current_user.result87
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_delete_no_where.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result64
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_if_exists.result98
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_temp.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_view.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_dual_pos_advance.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_empty_master_host.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_err_ignoredtable.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result (renamed from mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result)35
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result (renamed from mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result)35
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result (renamed from mysql-test/suite/rpl/r/rpl_extraCol_innodb.result)67
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result (renamed from mysql-test/suite/rpl/r/rpl_extraCol_myisam.result)67
-rw-r--r--mysql-test/suite/rpl/r/rpl_failed_optimize.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result106
-rw-r--r--mysql-test/suite/rpl/r/rpl_flush_logs.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_free_items.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_geometry.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_lock.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_grant.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result52
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result95
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_idempotency.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_revoke.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table_update.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave_errors.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30888.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_duplicate.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id_pk.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result71
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_select.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_invoked_features.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix2.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv6.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_killed_ddl.result59
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_map.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_symlink.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result51
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_locale.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_manual_change_index_file.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_many_optimize.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mix_found_rows.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result76
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete2.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update2.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update3.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update4.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mysql_upgrade.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_name_const.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_not_null_innodb.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_not_null_myisam.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_optimize.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_plugin_load.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_only.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_myisam.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayrotate.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayspace.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_report.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_4_bytes.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_NOW.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_USER.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_UUID.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result80
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_myisam.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_colSize.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_conflicts.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_delayed_ins.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_find_row.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func002.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func003.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_idempotency.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_insert_delayed.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result63
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result205
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp003.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp005.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp008.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp009.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp010.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp011.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp012.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result288
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig002.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig003.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig004.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trunc_temp.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_utf16.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_utf32.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_view01.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_wide_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_savepoint.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id.result34
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id_ignore.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_session_var.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_charset.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_null_innodb.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_null_myisam.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_sf.result68
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_hosts.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_running.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_in.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp004.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_spec_variables.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_sporadic_master.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result60
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result76
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_conflicts.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_found_rows.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_loadfile.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result188
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_multi_query.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_no_op.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_sql_mode.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_user_variables.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result122
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result66
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_errors.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_test_framework.result170
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_trunc_temp.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv.result34
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv_innodb.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_udf.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_user.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_user_variables.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables_stm.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_view.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_multi.result9
-rw-r--r--mysql-test/suite/rpl/t/disabled.def10
-rw-r--r--mysql-test/suite/rpl/t/rpl000017-slave.sh12
-rw-r--r--mysql-test/suite/rpl/t/rpl000017.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_000010-slave.opt (renamed from mysql-test/suite/rpl/t/rpl000010-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000010.test (renamed from mysql-test/suite/rpl/t/rpl000010.test)1
-rw-r--r--mysql-test/suite/rpl/t/rpl_000011.test (renamed from mysql-test/suite/rpl/t/rpl000011.test)1
-rw-r--r--mysql-test/suite/rpl/t/rpl_000013.test (renamed from mysql-test/suite/rpl/t/rpl000013.test)4
-rw-r--r--mysql-test/suite/rpl/t/rpl_000017.test48
-rw-r--r--mysql-test/suite/rpl/t/rpl_EE_err.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_LD_INFILE.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_db.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_11932.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors.test413
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test32
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit_npk.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug31076.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931.test25
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug37426.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug38694.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug41902.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_change_master.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset_sjis.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf11
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test291
-rw-r--r--mysql-test/suite/rpl/t/rpl_colSize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_concurrency_error.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_conditional_comments.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_if_not_exists.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_critical_errors.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user.cnf7
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user.test141
-rw-r--r--mysql-test/suite/rpl/t/rpl_ddl.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_delete_no_where.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_if_exists.test115
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_view.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test41
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_host.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_myisam.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test (renamed from mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test)4
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test (renamed from mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test)4
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_flush_logs.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh5
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh4
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_free_items.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_geometry.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_lock.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_grant.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf11
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test133
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_basic.test127
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_revoke.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table_update.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave_errors.test28
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30888.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_duplicate.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_select.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv6.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_killed_ddl.test29
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_charset.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_simple.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test78
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_locale.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_manual_change_index_file.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_many_optimize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_misc_functions.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mix_found_rows.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete2.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update3.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update4.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mysql_upgrade.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_name_const.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_not_null_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_not_null_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_optimize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_plugin_load.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test41
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_myisam.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace.test46
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_report.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_NOW.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_USER.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_UUID.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_8partition.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_colSize.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_conflicts.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test38
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_delayed_ins.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_find_row.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func002.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_idempotency.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_insert_delayed.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp008.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp009.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp010.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp011.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp012.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig002.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig004.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trunc_temp.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_utf16.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_utf32.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_view01.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_wide_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_savepoint.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id.test29
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id_ignore.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_session_var.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_charset.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_null_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_null_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sf.test187
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_hosts.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_running.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_in.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test26
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp004.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_spec_variables.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl1.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001.test130
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_conflicts.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_found_rows.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_loadfile.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_multi_query.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_no_op.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_sql_mode.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_user_variables.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test119
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test68
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt3
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_test_framework.cnf46
-rw-r--r--mysql-test/suite/rpl/t/rpl_test_framework.test143
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_trunc_temp.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_3innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_user.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_user_variables.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test36
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables_stm.test28
-rw-r--r--mysql-test/suite/rpl/t/rpl_view.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_view_multi.test1
616 files changed, 5299 insertions, 5553 deletions
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
index 79825016448..89db1c3545d 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -82,3 +80,4 @@ sync_slave_with_master;
# the files your self to see what is not matching
--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index d953397c0cb..dc245b8d38c 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -342,3 +340,4 @@ sync_slave_with_master;
# the files your self to see what is not matching
--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl000011.result b/mysql-test/suite/rpl/r/rpl000011.result
deleted file mode 100644
index dd0fa2fbe74..00000000000
--- a/mysql-test/suite/rpl/r/rpl000011.result
+++ /dev/null
@@ -1,16 +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);
-insert into t1 values(1);
-stop slave;
-start slave;
-insert into t1 values(2);
-select * from t1;
-n
-1
-2
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl000010.result b/mysql-test/suite/rpl/r/rpl_000010.result
index 65191ea411f..4bb87a765cd 100644
--- a/mysql-test/suite/rpl/r/rpl000010.result
+++ b/mysql-test/suite/rpl/r/rpl_000010.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
@@ -12,3 +8,4 @@ n
1
2
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000011.result b/mysql-test/suite/rpl/r/rpl_000011.result
new file mode 100644
index 00000000000..8a59eb746ad
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_000011.result
@@ -0,0 +1,15 @@
+include/master-slave.inc
+[connection master]
+create table t1 (n int);
+insert into t1 values(1);
+stop slave;
+include/wait_for_slave_to_stop.inc
+start slave;
+include/wait_for_slave_to_start.inc
+insert into t1 values(2);
+select * from t1;
+n
+1
+2
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl000013.result b/mysql-test/suite/rpl/r/rpl_000013.result
index 37838bb88e0..e94a469e970 100644
--- a/mysql-test/suite/rpl/r/rpl000013.result
+++ b/mysql-test/suite/rpl/r/rpl_000013.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
@@ -26,3 +22,4 @@ Slave_open_temp_tables 0
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl000017.result b/mysql-test/suite/rpl/r/rpl_000017.result
index 403f4d4d4fe..1b4f9f1e8a3 100644
--- a/mysql-test/suite/rpl/r/rpl000017.result
+++ b/mysql-test/suite/rpl/r/rpl_000017.result
@@ -1,11 +1,8 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+include/master-slave.inc
+[connection master]
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
-start slave;
-drop table if exists t1;
+include/start_slave.inc
create table t1(n int);
insert into t1 values(24);
select * from t1;
@@ -13,3 +10,4 @@ n
24
drop table t1;
delete from mysql.user where user="replicate";
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result
index 8c1277445b2..8220f4e0c8d 100644
--- a/mysql-test/suite/rpl/r/rpl_EE_err.result
+++ b/mysql-test/suite/rpl/r/rpl_EE_err.result
@@ -1,11 +1,8 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int) engine=myisam;
flush tables;
drop table if exists t1;
Warnings:
Warning 2 Can't find file: 't1' (errno: 2)
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index b092dd9e088..3280d4bbaf7 100644
--- a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
@@ -115,3 +111,4 @@ abasement
abased
abase
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 6ef5ce3462a..2cffa70d778 100644
--- a/mysql-test/suite/rpl/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
@@ -1,10 +1,5 @@
-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;
-drop database if exists mysqltest;
+include/master-slave.inc
+[connection master]
create database mysqltest;
create table mysqltest.t1 ( n int);
alter table mysqltest.t1 add m int;
@@ -19,3 +14,4 @@ select * from mysqltest.t3;
n
45
drop database mysqltest;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 60c07d0dede..55adbfeda79 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
@@ -1,12 +1,9 @@
-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;
+include/master-slave.inc
+[connection master]
==== 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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 831e9b5c8b5..a0478947c72 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3);
select * from t1;
@@ -244,12 +240,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
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;
+include/rpl_reset.inc
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
@@ -303,12 +294,30 @@ id
INSERT INTO t1 VALUES(4);
INSERT INTO t2 VALUES(4);
FLUSH LOGS;
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1;
DROP TABLE t2;
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
+CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
+BEGIN;
+# Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
+# zero to fill the auto_increment field.
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+INSERT INTO t1(id,data) VALUES(0,2);
+# Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
+# affect the execution of the transaction on slave.
+SET SQL_MODE=0;
+COMMIT;
+SELECT * FROM t1;
+id data
+0 2
+SELECT * FROM t1;
+id data
+0 2
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
index 25eda6ee454..62ff28e7159 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists test1;
create database test1;
use test1;
@@ -44,4 +40,4 @@ id fname
1 testtest 1
2 test
drop database test1;
-drop database test1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
new file mode 100644
index 00000000000..71c6ff57f80
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
@@ -0,0 +1,45 @@
+include/master-slave.inc
+[connection master]
+==== Initialize ====
+SET @old_relay_log_purge= @@global.relay_log_purge;
+include/setup_fake_relay_log.inc
+Setting up fake replication from MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
+==== Test ====
+start slave sql_thread;
+include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
+# Result on slave
+SELECT * FROM t1;
+id
+5
+6
+7
+8
+9
+10
+11
+SELECT * FROM t2;
+id
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+==== Clean up ====
+stop slave sql_thread;
+include/cleanup_fake_relay_log.inc
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+SET @@global.relay_log_purge= @old_relay_log_purge;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result b/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
index b2cc92491c3..af84978dc80 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
# Test case1: INVOKES A TRIGGER with after insert action
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -110,9 +106,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -226,9 +222,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -342,9 +338,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after update action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -458,9 +454,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before update action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -574,9 +570,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after delete action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -690,9 +686,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before delete action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -761,8 +757,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with after insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t3, slave:t3]
drop table t1;
drop table t2;
drop table t3;
@@ -828,8 +824,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with before insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t3, slave:t3]
drop table t1;
drop table t2;
drop table t3;
@@ -853,7 +849,7 @@ INSERT INTO v16(c1) VALUES (25), (26);
commit;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t3, slave:t3]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -877,7 +873,7 @@ INSERT INTO v16(c1) VALUES (25), (26);
commit;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t3, slave:t3]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -980,8 +976,8 @@ master-bin.000001 # Query # # use `test`; insert into t2(a,b) values(3,3)
master-bin.000001 # Xid # # COMMIT /* XID */
#Test if the results are consistent on master and slave
#for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT'
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
drop table t1;
drop table t2;
# Test case14: INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES
@@ -1034,8 +1030,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO v15(c2) VALUES (25), (26)
master-bin.000001 # Xid # # COMMIT /* XID */
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES'
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
drop table t1;
drop table t2;
drop view v15;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
index 94c4e31d584..4cddb7d2cc7 100644
--- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
+++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
SET @@session.binlog_direct_non_transactional_updates= FALSE;
@@ -52,6 +48,7 @@ before call db1.p1()
after call db1.p1()
[on slave]
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_POS;
+include/wait_for_slave_sql_to_stop.inc
#
# If we got non-zero here, then we're suffering BUG#43263
#
@@ -92,6 +89,7 @@ executed db1.p2()
after call db1.p2()
[on slave]
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_POS;
+include/wait_for_slave_sql_to_stop.inc
#
# If we got non-zero here, then we're suffering BUG#43263
#
@@ -110,6 +108,7 @@ s
before call db1.p1()
executed db1.p2()
START SLAVE;
+include/wait_for_slave_sql_to_start.inc
#
# SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263
# This was reported by BUG#50407
@@ -178,3 +177,4 @@ a
#
DROP DATABASE db1;
DROP DATABASE db2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result b/mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result
deleted file mode 100644
index f0fdd5eaa1f..00000000000
--- a/mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result
+++ /dev/null
@@ -1,37 +0,0 @@
-Setting up fake replication from MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
-start slave sql_thread;
-select MASTER_POS_WAIT('master-bin.000001', 3776);
-# Result on slave
-SELECT * FROM t1;
-id
-5
-6
-7
-8
-9
-10
-11
-SELECT * FROM t2;
-id
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-DROP TABLE IF EXISTS t1, t2;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP FUNCTION IF EXISTS f1;
-DROP TRIGGER IF EXISTS tr1;
-stop slave sql_thread;
-Cleaning up after setup_fake_relay_log.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
index f94d2833603..a2a065e0a4f 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
@@ -1,8 +1,16 @@
+include/master-slave.inc
+[connection master]
call mtr.add_suppression('Found invalid event in binary log');
+call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
==== Initialize ====
+include/stop_slave.inc
+RESET SLAVE;
+include/setup_fake_relay_log.inc
Setting up fake replication from MYSQL_TEST_DIR/std_data/bug40482-bin.000001
==== Test ====
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1594]
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
+include/cleanup_fake_relay_log.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
new file mode 100644
index 00000000000..be1b3b150bc
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
@@ -0,0 +1,278 @@
+include/master-slave.inc
+[connection master]
+#######################################################################
+####################### PART 1: MASTER TESTS ##########################
+#######################################################################
+include/stop_slave.inc
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+SET @old_debug= @@global.debug;
+SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data';
+SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data';
+RESET MASTER;
+###################### TEST #1
+FLUSH LOGS;
+# assert: must show two binlogs
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+###################### TEST #2
+RESET MASTER;
+SET GLOBAL debug="+d,error_unique_log_filename";
+FLUSH LOGS;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show one binlog
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+SET GLOBAL debug="";
+RESET MASTER;
+###################### TEST #3
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+# assert: must show two binlog
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #4
+SET GLOBAL debug="+d,error_unique_log_filename";
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show one entry
+SELECT count(*) FROM t2;
+count(*)
+1
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #5
+SET GLOBAL debug="+d,error_unique_log_filename";
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
+# assert: must show one entry
+SELECT count(*) FROM t2;
+count(*)
+1
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #6
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+INSERT INTO t2 VALUES ('muse');
+COMMIT;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show three entries
+SELECT count(*) FROM t2;
+count(*)
+3
+SET AUTOCOMMIT= 1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #7
+SET GLOBAL debug="+d,error_unique_log_filename";
+SELECT count(*) FROM t4;
+count(*)
+0
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show 1 entry
+SELECT count(*) FROM t4;
+count(*)
+1
+### check that the incident event is written to the current log
+SET GLOBAL debug="-d,error_unique_log_filename";
+FLUSH LOGS;
+SHOW BINLOG EVENTS IN 'BINLOG_FILE' FROM <binlog_start> LIMIT 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+BINLOG_FILE # Incident # # #1 (LOST_EVENTS)
+DELETE FROM t4;
+RESET MASTER;
+###################### TEST #8
+SET GLOBAL debug="+d,error_unique_log_filename";
+# must show 0 entries
+SELECT count(*) FROM t4;
+count(*)
+0
+SELECT count(*) FROM t2;
+count(*)
+0
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# INFO: Count(*) Before Offending DELETEs
+# assert: must show 1 entry
+SELECT count(*) FROM t4;
+count(*)
+1
+# assert: must show 4 entries
+SELECT count(*) FROM t2;
+count(*)
+4
+DELETE FROM t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+DELETE FROM t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# INFO: Count(*) After Offending DELETEs
+# assert: must show zero entries
+SELECT count(*) FROM t4;
+count(*)
+0
+SELECT count(*) FROM t2;
+count(*)
+0
+SET GLOBAL debug="-d,error_unique_log_filename";
+###################### TEST #9
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+# assert: must show four entries
+SELECT count(*) FROM t2;
+count(*)
+4
+SELECT count(*) FROM t4;
+count(*)
+4
+DELETE FROM t2;
+DELETE FROM t4;
+# assert: must show zero entries
+SELECT count(*) FROM t2;
+count(*)
+0
+SELECT count(*) FROM t4;
+count(*)
+0
+SET SQL_LOG_BIN=1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+###################### TEST #10
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not open .*");
+RESET MASTER;
+SHOW WARNINGS;
+Level Code Message
+SET GLOBAL debug="+d,fault_injection_registering_index";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1)
+SET GLOBAL debug="-d,fault_injection_registering_index";
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+###################### TEST #11
+include/rpl_restart_server.inc [server_number=1]
+SET GLOBAL debug="+d,fault_injection_openning_index";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.index' (errno: 1)
+SET GLOBAL debug="-d,fault_injection_openning_index";
+RESET MASTER;
+ERROR HY000: Binlog closed, cannot RESET MASTER
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+include/rpl_restart_server.inc [server_number=1]
+###################### TEST #12
+SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin' (errno: 2)
+SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
+RESET MASTER;
+ERROR HY000: Binlog closed, cannot RESET MASTER
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+include/rpl_restart_server.inc [server_number=1]
+SET GLOBAL debug= @old_debug;
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+include/start_slave.inc
+#######################################################################
+####################### PART 2: SLAVE TESTS ###########################
+#######################################################################
+include/rpl_reset.inc
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+###################### TEST #13
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,error_unique_log_filename";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,error_unique_log_filename";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #14
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #15
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,fault_injection_registering_index";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,fault_injection_registering_index";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #16
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,fault_injection_openning_index";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,fault_injection_openning_index";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+include/stop_slave_sql.inc
+Warnings:
+Note 1255 Slave already has been stopped
+SET GLOBAL debug=@old_debug;
+RESET SLAVE;
+RESET MASTER;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
index 7a2e3183d5b..ccc7116a949 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -1,10 +1,5 @@
-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;
-drop database if exists d1;
+include/master-slave.inc
+[connection master]
create database d1;
use d1;
create table t (s1 int) engine=innodb;
@@ -30,3 +25,4 @@ Grants for x@y
GRANT USAGE ON *.* TO 'x'@'y'
drop user x@y;
drop database d1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result b/mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result
deleted file mode 100644
index 520d500ed7c..00000000000
--- a/mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result
+++ /dev/null
@@ -1,11 +0,0 @@
-drop table if exists t1;
-reset master;
-create table t1 (a int);
-insert into t1 values (1);
-flush logs;
-drop table t1;
-*** must be 1 ***
-select * from t1;
-a
-1
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_bit.result b/mysql-test/suite/rpl/r/rpl_bit.result
index 924de8a65f8..fa935cd9e56 100644
--- a/mysql-test/suite/rpl/r/rpl_bit.result
+++ b/mysql-test/suite/rpl/r/rpl_bit.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@@ -136,3 +132,4 @@ hex(bit3)
24
35
DROP TABLE IF EXISTS test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bit_npk.result b/mysql-test/suite/rpl/r/rpl_bit_npk.result
index 9599660f18f..13c9985614e 100644
--- a/mysql-test/suite/rpl/r/rpl_bit_npk.result
+++ b/mysql-test/suite/rpl/r/rpl_bit_npk.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@@ -167,3 +163,4 @@ a b
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
index b28261bef9b..1fb8dd6d125 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (a INT, b INT, c INT);
CREATE TABLE t2 (a INT, b INT, c INT);
@@ -91,4 +87,5 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-drop table t1,t2;
+DROP TABLE t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
index c6dd2d01ed3..a3725f34a55 100644
--- a/mysql-test/suite/rpl/r/rpl_bug26395.result
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
@@ -20,6 +16,7 @@ SELECT * FROM tinnodb ORDER BY a;
a
1
[on slave]
+include/sync_slave_io_with_master.inc
==== Verify results on slave ====
include/stop_slave.inc
SELECT "" AS Slave_IO_State;
@@ -39,3 +36,4 @@ DROP TABLE tinnodb;
set @@debug= @old_debug;
[on slave]
DROP TABLE tinnodb;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result
index 76bce39fc43..1cf8b87f68d 100644
--- a/mysql-test/suite/rpl/r/rpl_bug31076.result
+++ b/mysql-test/suite/rpl/r/rpl_bug31076.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
CREATE DATABASE track;
@@ -70,3 +66,4 @@ event_id visit_id timestamp src data visits_events_id
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
DROP DATABASE track;
End of 5.1 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index a7f398f4546..ce8b6b169c7 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -1,7 +1,13 @@
-reset master;
-reset slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Failed during slave I/O thread initialization");
+call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593");
+include/stop_slave.inc
+reset slave;
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
-Last_SQL_Error = Failed during slave thread initialization
+include/wait_for_slave_sql_error.inc [errno=1593]
+Last_SQL_Error = 'Failed during slave thread initialization'
SET GLOBAL debug="";
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug37426.result b/mysql-test/suite/rpl/r/rpl_bug37426.result
new file mode 100644
index 00000000000..bf96255c7b4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_bug37426.result
@@ -0,0 +1,12 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
+INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
+SELECT * FROM char128_utf8;
+i1 c i2
+1 123 1
+SELECT * FROM char128_utf8;
+i1 c i2
+1 123 1
+DROP TABLE char128_utf8;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug38694.result b/mysql-test/suite/rpl/r/rpl_bug38694.result
index 711c4a91c03..b666d9a9155 100644
--- a/mysql-test/suite/rpl/r/rpl_bug38694.result
+++ b/mysql-test/suite/rpl/r/rpl_bug38694.result
@@ -1,6 +1,3 @@
-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;
+include/master-slave.inc
+[connection master]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-test/suite/rpl/r/rpl_bug41902.result
index c65773708cc..5331d4334fa 100644
--- a/mysql-test/suite/rpl/r/rpl_bug41902.result
+++ b/mysql-test/suite/rpl/r/rpl_bug41902.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
stop slave;
SET @@debug="d,simulate_find_log_pos_error";
reset slave;
@@ -31,4 +27,6 @@ purge binary logs to 'master-bin.000001';
ERROR HY000: Target log not found in binlog index
SET @@debug="";
purge binary logs to 'master-bin.000001';
-End of the tests
+==== clean up ====
+CHANGE MASTER TO MASTER_HOST = '127.0.0.1';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result
index af09bed8dce..6674ab168ef 100644
--- a/mysql-test/suite/rpl/r/rpl_change_master.result
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result
@@ -1,15 +1,12 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(n int);
select * from t1;
n
stop slave sql_thread;
insert into t1 values(1);
insert into t1 values(2);
+include/wait_for_slave_param.inc [Read_Master_Log_Pos]
include/stop_slave.inc
change master to master_user='root';
start slave;
@@ -18,20 +15,4 @@ n
1
2
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 (a int);
-insert into t1 values (1);
-flush logs;
-insert into t1 values (2);
-include/stop_slave.inc
-delete from t1 where a=2;
-CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4;
-start slave sql_thread;
-start slave io_thread;
-set global relay_log_purge=1;
-drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-test/suite/rpl/r/rpl_charset.result
index a4841b0baf3..5b025445050 100644
--- a/mysql-test/suite/rpl/r/rpl_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_charset.result
@@ -1,12 +1,6 @@
-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;
+include/master-slave.inc
+[connection master]
set timestamp=1000000000;
-drop database if exists mysqltest2;
-drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
@@ -141,3 +135,4 @@ primary key (`pk`)
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
index 770ad0588d1..b31bad28a59 100644
--- a/mysql-test/suite/rpl/r/rpl_charset_sjis.result
+++ b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
drop procedure if exists p1;
create table t1 (a varchar(255) character set sjis);
@@ -24,3 +20,4 @@ hex(a)
965C
drop table t1;
drop procedure p1;
+include/rpl_end.inc
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
index c3ccc76d1bc..f9c5b48e227 100644
--- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -1,60 +1,11 @@
-*** 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;
+*** Set up circular replication on four servers ***
+include/rpl_init.inc [topology=1->2->3->4->1]
*** 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;
+include/rpl_sync.inc
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
*** Testing schema A->B->C->D->A ***
@@ -62,6 +13,7 @@ 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);
+include/rpl_sync.inc
SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
Master A a b
Master A 1 A
@@ -95,6 +47,8 @@ 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);
+call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062");
+include/wait_for_slave_sql_error.inc [errno=1062]
INSERT INTO t1(b,c) VALUES('A',2);
INSERT INTO t1(b,c) VALUES('D',2);
@@ -116,9 +70,9 @@ 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/stop_slave_io.inc
+include/stop_slave.inc
+include/rpl_change_topology.inc [new topology=1->2->4->1,2->3]
include/start_slave.inc
* Check data inserted before failure *
@@ -145,6 +99,7 @@ Master D 8 D
INSERT INTO t1(b,c) VALUES('A',3);
INSERT INTO t1(b,c) VALUES('B',3);
INSERT INTO t1(b,c) VALUES('D',3);
+include/rpl_sync.inc
SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
Master A a b
Master A 9 A
@@ -168,11 +123,12 @@ Master D 12 D
* Remove wrong event from C and restore B->C->D *
include/stop_slave.inc
DELETE FROM t1 WHERE a = 6;
-START SLAVE;
+include/start_slave.inc
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;
+include/rpl_change_topology.inc [new topology=1->2->3->4->1]
+include/start_slave.inc
+include/rpl_sync.inc
* 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;
@@ -213,6 +169,7 @@ 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);
+include/rpl_sync.inc
SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
Master A a b
Master A 13 A
@@ -241,6 +198,7 @@ Master D 16 D
* Transactions with commits *
BEGIN;
BEGIN;
+include/rpl_sync.inc
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
Master A b COUNT(*)
Master A A 100
@@ -269,6 +227,7 @@ Master D D 100
* Transactions with rollbacks *
BEGIN;
BEGIN;
+include/rpl_sync.inc
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
Master A b COUNT(*)
Master A B 100
@@ -288,11 +247,4 @@ 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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result
index ae1ac3c7fed..0f701e32d9b 100644
--- a/mysql-test/suite/rpl/r/rpl_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_colSize.result
@@ -1,13 +1,10 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
**** Testing WL#3228 changes. ****
*** Create "wider" table on slave ***
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
RESET SLAVE;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
@@ -57,6 +54,7 @@ t LONGTEXT
RESET MASTER;
*** Start replication ***
START SLAVE;
+include/wait_for_slave_to_start.inc
*** Insert data on master and display it. ***
INSERT INTO t1 () VALUES (
17.567,
@@ -180,3 +178,4 @@ t1 CREATE TABLE `t1` (
*** Cleanup ***
DROP TABLE t1;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_commit_after_flush.result b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
index eaddda63b6a..b91b273e64e 100644
--- a/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
+++ b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT) ENGINE=innodb;
begin;
insert into t1 values(1);
@@ -11,3 +7,4 @@ flush tables with read lock;
commit;
unlock tables;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result
index eb303c46f28..b6ed9db6c66 100644
--- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result
+++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
########################################################################
# Environment
@@ -118,11 +114,12 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown")
master-bin.000001 # Xid # # COMMIT /* XID */
-source include/diff_master_slave.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
+include/rpl_diff.inc
########################################################################
# Cleanup
########################################################################
DROP TRIGGER tr;
DROP TABLE t;
DROP TABLE n;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_conditional_comments.result b/mysql-test/suite/rpl/r/rpl_conditional_comments.result
index 0a2f4d60e6f..fca7d941718 100644
--- a/mysql-test/suite/rpl/r/rpl_conditional_comments.result
+++ b/mysql-test/suite/rpl/r/rpl_conditional_comments.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1(c1 INT);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -19,7 +15,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; /* 99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /* 99999 ,(11)*/
master-bin.000001 # Query # # COMMIT
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
# Case 2:
# -----------------------------------------------------------------
@@ -30,7 +26,7 @@ EXECUTE stmt;
DROP TABLE t1;
CREATE TABLE t1(c1 INT);
EXECUTE stmt;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
SET @value=62;
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/';
@@ -56,7 +52,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT)
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/
master-bin.000001 # Query # # COMMIT
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
# Case 3:
# -----------------------------------------------------------------
@@ -65,3 +61,4 @@ Comparing tables master:test.t1 and slave:test.t1
SELECT c1 FROM /*!99999 t1 WHEREN;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!99999 t1 WHEREN' at line 1
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_database.result b/mysql-test/suite/rpl/r/rpl_create_database.result
index 9780b65f334..6bb950483ed 100644
--- a/mysql-test/suite/rpl/r/rpl_create_database.result
+++ b/mysql-test/suite/rpl/r/rpl_create_database.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
@@ -60,3 +56,4 @@ t2
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
index 0d3fc1b79a7..d12f3ff1360 100644
--- a/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
+++ b/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE IF NOT EXISTS mysqltest;
USE mysqltest;
@@ -69,12 +65,7 @@ DROP TABLE t3;
# After the worklog, it will insert nothing and the statement will not be
# binlogged if the table already exists.
# After the worklog, some bugs will disappear automotically.
-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;
+include/rpl_reset.inc
# Case 1: BUG#47132
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
@@ -126,3 +117,4 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
DROP VIEW v1;
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
index 7459a977cf8..6bafbb32897 100644
--- a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
+++ b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int);
CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int);
@@ -19,3 +15,4 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS t
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result
index de5dd134516..ddb97ffa8c5 100644
--- a/mysql-test/suite/rpl/r/rpl_cross_version.result
+++ b/mysql-test/suite/rpl/r/rpl_cross_version.result
@@ -1,12 +1,19 @@
+include/master-slave.inc
+[connection master]
==== Initialize ====
+include/stop_slave.inc
+RESET SLAVE;
+include/setup_fake_relay_log.inc
Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
==== Test ====
start slave sql_thread;
+include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
==== 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
+include/stop_slave_sql.inc
+include/cleanup_fake_relay_log.inc
drop table t1, t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_current_user.result b/mysql-test/suite/rpl/r/rpl_current_user.result
index 69c20078531..ecf8fc851d8 100644
--- a/mysql-test/suite/rpl/r/rpl_current_user.result
+++ b/mysql-test/suite/rpl/r/rpl_current_user.result
@@ -1,26 +1,6 @@
-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("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
-
-# On slave2
-# Connect slave2 to slave
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_MYPORT;,
-MASTER_LOG_FILE='slave-bin.000001', MASTER_USER='root';
-START SLAVE;
-
-# [On master]
-DROP VIEW IF EXISTS v_user;
-DROP VIEW IF EXISTS v_tables_priv;
-DROP VIEW IF EXISTS v_procs_priv;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS my_grant;
-DROP PROCEDURE IF EXISTS my_revoke;
-DROP FUNCTION IF EXISTS my_user;
-DROP EVENT IF EXISTS e1;
+include/rpl_init.inc [topology=1->2->3]
+include/rpl_connect.inc [creating master]
+include/rpl_connect.inc [creating slave]
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
@@ -42,76 +22,76 @@ ERROR HY000: String '01234567890123456789012345678901234567890123456789012345678
# [On conn1]
# Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'GRANT ... ON TABLE ...' statement
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'GRANT ... ON PROCEDURE...' statement
GRANT ALTER ROUTINE, EXECUTE ON PROCEDURE p1 TO CURRENT_USER();
-Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
-Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv]
# Verify 'GRANT ... ON *.* ...' statement
GRANT ALL PRIVILEGES ON *.* TO CURRENT_USER() WITH GRANT OPTION;
-Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
-Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv]
# Verify 'REVOKE ... ON TABLE ...' statement
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'REVOKE ... ON PROCEDURE...' statement
REVOKE ALTER ROUTINE, EXECUTE ON PROCEDURE p1 FROM CURRENT_USER();
-Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
-Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv]
# Verify 'REVOKE ... ON *.* ...' statement
REVOKE ALL PRIVILEGES ON *.* FROM CURRENT_USER();
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'GRANT ...' statement in the procedure
CREATE PROCEDURE my_grant()
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
call my_grant;
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'REVOKE ... ON TABLE ...' statement in the procedure
CREATE PROCEDURE my_revoke()
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
call my_revoke;
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'RENAME USER ...' statement
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'DROP USER ...' statement
GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
DROP USER CURRENT_USER();
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'ALTER EVENT...' statement
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
# Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
-Comparing tables master:test.v_event and slave:test.v_event
-Comparing tables master:test.v_event and slave2:test.v_event
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_event, server_2:v_event, server_3:v_event]
# Session user will be set as definer, if the statement does not assign
# a definer
ALTER EVENT e1 ENABLE;
-Comparing tables master:test.v_event and slave:test.v_event
-Comparing tables master:test.v_event and slave2:test.v_event
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_event, server_2:v_event, server_3:v_event]
# Verify that this patch does not affect the calling of CURRENT_USER()
# in the other statements
@@ -128,7 +108,7 @@ SELECT * FROM t1;
c1
@
1234
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
@
@@ -146,7 +126,7 @@ SELECT * FROM t1;
c1
@
@
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
@
@@ -160,7 +140,7 @@ c1
# [On slave]
SELECT * FROM t1;
c1
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
# [On master]
@@ -187,7 +167,7 @@ c1
SELECT * FROM t2;
c1
@
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
@
@@ -203,3 +183,4 @@ DROP PROCEDURE my_grant;
DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index 1485389204b..c399b408d5c 100644
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
*** Prepare tables and data ***
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t2 (a INT) ENGINE=innodb;
@@ -50,7 +46,7 @@ a
SELECT * FROM t3;
a
3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
*** Test lock wait timeout ***
include/stop_slave.inc
@@ -61,6 +57,7 @@ SELECT * FROM t1 FOR UPDATE;
a
1
START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1205]
SELECT COUNT(*) FROM t2;
COUNT(*)
0
@@ -74,7 +71,7 @@ SELECT * FROM t3;
a
3
3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
*** Test lock wait timeout and purged relay logs ***
SET @my_max_relay_log_size= @@global.max_relay_log_size;
@@ -88,6 +85,7 @@ a
1
1
START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1205]
SELECT COUNT(*) FROM t2;
COUNT(*)
0
@@ -103,9 +101,10 @@ a
3
3
3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
*** Clean up ***
DROP TABLE t1,t2,t3;
SET global max_relay_log_size= @my_max_relay_log_size;
End of 5.1 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_delete_no_where.result b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
index 78edf4bf3fa..923cd428aec 100644
--- a/mysql-test/suite/rpl/r/rpl_delete_no_where.result
+++ b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int, b int) engine=myisam;
insert into t1 values(1,1);
select * from t1;
@@ -13,3 +9,4 @@ delete from t1;
select * from t1;
a b
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 45c5bcf7ba0..772ffd1db20 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
@@ -166,22 +162,13 @@ USE test;
DROP FUNCTION bug42217_db.upgrade_del_func;
DROP FUNCTION bug42217_db.upgrade_alter_func;
DROP DATABASE bug42217_db;
-stop slave;
+SET SQL_LOG_BIN= 0;
DROP USER 'create_rout_db'@'localhost';
-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 SQL_LOG_BIN= 1;
+include/rpl_reset.inc
+USE test;
######## BUG#49119 #######
### i) test case from the 'how to repeat section'
-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(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost';
@@ -189,12 +176,7 @@ ERROR 42000: There is no such grant defined for user 'root' on host 'localhost'
DROP TABLE t1;
DROP PROCEDURE p1;
### ii) Test case in which REVOKE partially succeeds
-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;
+include/rpl_reset.inc
CREATE TABLE t1(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
CREATE USER 'user49119'@'localhost';
@@ -208,6 +190,7 @@ GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
##############################################################
### Showing grants for both users: root and user49119 (master)
@@ -218,6 +201,7 @@ GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
## This statement will make the revoke fail because root has no
## execute grant. However, it will still revoke the grant for
@@ -233,6 +217,7 @@ GRANT USAGE ON *.* TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
#############################################################
### Showing grants for both users: root and user49119 (slave)
@@ -243,16 +228,12 @@ GRANT USAGE ON *.* TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
DROP TABLE t1;
DROP PROCEDURE p1;
DROP USER 'user49119'@'localhost';
-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;
+include/rpl_reset.inc
grant all on *.* to foo@"1.2.3.4";
revoke all privileges, grant option from "foo";
ERROR HY000: Can't revoke all privileges for one or more of the requested users
@@ -260,5 +241,24 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4"
master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo"
+include/check_slave_no_error.inc
DROP USER foo@"1.2.3.4";
-"End of test"
+
+# Bug#27606 GRANT statement should be replicated with DEFINER information
+include/rpl_reset.inc
+GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+DROP USER user_bug27606@localhost;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop.result b/mysql-test/suite/rpl/r/rpl_drop.result
index b83594c9bb1..bdba42e1d34 100644
--- a/mysql-test/suite/rpl/r/rpl_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_drop.result
@@ -1,10 +1,6 @@
-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;
-drop table if exists t1, t2;
+include/master-slave.inc
+[connection master]
create table t1 (a int);
drop table t1, t2;
ERROR 42S02: Unknown table 't2'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index 8825797f80d..8a88f01a444 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
create table mysqltest1.t1 (n int);
@@ -34,4 +30,4 @@ n
use test;
drop table t1;
drop database mysqltest1;
-include/stop_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_if_exists.result b/mysql-test/suite/rpl/r/rpl_drop_if_exists.result
deleted file mode 100644
index 0c398bed440..00000000000
--- a/mysql-test/suite/rpl/r/rpl_drop_if_exists.result
+++ /dev/null
@@ -1,98 +0,0 @@
-RESET MASTER;
-DROP PROCEDURE IF EXISTS db_bug_13684.p;
-DROP FUNCTION IF EXISTS db_bug_13684.f;
-DROP TRIGGER IF EXISTS db_bug_13684.tr;
-DROP VIEW IF EXISTS db_bug_13684.v;
-DROP EVENT IF EXISTS db_bug_13684.e;
-DROP TABLE IF EXISTS db_bug_13684.t;
-DROP DATABASE IF EXISTS db_bug_13684;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
-master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
-master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
-master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
-master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
-master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
-CREATE DATABASE db_bug_13684;
-CREATE TABLE db_bug_13684.t (a int);
-CREATE EVENT db_bug_13684.e
-ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
-DO
-UPDATE db_bug_13684.t SET a = a + 1;
-CREATE VIEW db_bug_13684.v
-AS SELECT * FROM db_bug_13684.t;
-CREATE TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
-FOR EACH ROW BEGIN
-END;
-CREATE PROCEDURE db_bug_13684.p (OUT p1 INT)
-BEGIN
-END;
-CREATE FUNCTION db_bug_13684.f (s CHAR(20))
-RETURNS CHAR(50) DETERMINISTIC
-RETURN s;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
-master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
-master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
-master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
-master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
-master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
-master-bin.000001 # Query # # CREATE DATABASE db_bug_13684
-master-bin.000001 # Query # # use `test`; CREATE TABLE db_bug_13684.t (a int)
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_bug_13684.e
-ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
-DO
-UPDATE db_bug_13684.t SET a = a + 1
-master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db_bug_13684`.`v` AS SELECT * FROM db_bug_13684.t
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
-FOR EACH ROW BEGIN
-END
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `db_bug_13684`.`p`(OUT p1 INT)
-BEGIN
-END
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `db_bug_13684`.`f`(s CHAR(20)) RETURNS char(50) CHARSET latin1
- DETERMINISTIC
-RETURN s
-DROP PROCEDURE IF EXISTS db_bug_13684.p;
-DROP FUNCTION IF EXISTS db_bug_13684.f;
-DROP TRIGGER IF EXISTS db_bug_13684.tr;
-DROP VIEW IF EXISTS db_bug_13684.v;
-DROP EVENT IF EXISTS db_bug_13684.e;
-DROP TABLE IF EXISTS db_bug_13684.t;
-DROP DATABASE IF EXISTS db_bug_13684;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
-master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
-master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
-master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
-master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
-master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
-master-bin.000001 # Query # # CREATE DATABASE db_bug_13684
-master-bin.000001 # Query # # use `test`; CREATE TABLE db_bug_13684.t (a int)
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_bug_13684.e
-ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
-DO
-UPDATE db_bug_13684.t SET a = a + 1
-master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db_bug_13684`.`v` AS SELECT * FROM db_bug_13684.t
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
-FOR EACH ROW BEGIN
-END
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `db_bug_13684`.`p`(OUT p1 INT)
-BEGIN
-END
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `db_bug_13684`.`f`(s CHAR(20)) RETURNS char(50) CHARSET latin1
- DETERMINISTIC
-RETURN s
-master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
-master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
-master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
-master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
-master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
-master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
diff --git a/mysql-test/suite/rpl/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result
index 726b8f2fe54..ffabd514b0f 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create database if not exists mysqltest;
use mysqltest;
create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
@@ -26,12 +22,7 @@ CREATE TEMPORARY TABLE tmp3 (a int);
DROP TEMPORARY TABLE tmp3;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
-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;
+include/rpl_reset.inc
CREATE TABLE t1 ( i INT );
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
@@ -47,3 +38,4 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i INT )
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE ttmp1 ( i INT )
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-test/suite/rpl/r/rpl_drop_view.result
index c359011612a..0688ce42bc2 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_view.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1, t2;
drop view if exists v1, v2, v3, not_exist_view;
create table t1 (a int);
@@ -27,3 +23,4 @@ select * from v3;
ERROR 42S02: Table 'test.v3' doesn't exist
==== clean up ====
drop table t1, t2, t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
index aa1a573d052..3a3bed1a6fd 100644
--- a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
+++ b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
@@ -1,12 +1,4 @@
-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;
-reset master;
-change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
-include/start_slave.inc
+include/rpl_init.inc [topology=1->2->1]
create table t1 (n int);
include/stop_slave.inc
create table t2 (n int);
@@ -25,6 +17,7 @@ insert into t3 values(4);
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
+include/wait_for_slave_sql_to_stop.inc
show tables;
Tables_in_test
t1
@@ -32,12 +25,14 @@ t2
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
+include/wait_for_slave_sql_to_stop.inc
select * from t3;
n
1
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
+include/wait_for_slave_sql_to_stop.inc
select * from t3;
n
1
@@ -55,6 +50,5 @@ t3
t4
t5
t6
-include/stop_slave.inc
-reset slave;
-drop table t1,t2,t3,t4,t5,t6;
+drop table t1, t2, t3, t4, t5, t6;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_host.result b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
index 46ef32d415b..8b0b4ec30df 100644
--- a/mysql-test/suite/rpl/r/rpl_empty_master_host.result
+++ b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
@@ -1,10 +1,7 @@
-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;
+include/master-slave.inc
+[connection master]
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
Master_Host = '127.0.0.1' (expected '127.0.0.1')
CHANGE MASTER TO MASTER_HOST="";
ERROR HY000: Incorrect arguments to MASTER_HOST
@@ -14,3 +11,5 @@ Master_Host = 'foo' (expected 'foo')
CHANGE MASTER TO MASTER_HOST="127.0.0.1";
Master_Host = '127.0.0.1' (expected '127.0.0.1')
START SLAVE;
+include/wait_for_slave_to_start.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
index f211d5d9a2f..c2ec7eb4ba4 100644
--- a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int primary key);
create table t4 (a int primary key);
insert into t1 values (1),(1);
@@ -40,3 +36,4 @@ a
3
4
DROP TABLE test.t4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index 7d4e8a208eb..23dcfab57f0 100644
--- a/mysql-test/suite/rpl/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET @old_event_scheduler = @@global.event_scheduler;
set global event_scheduler=1;
DROP EVENT IF EXISTS test.justonce;
@@ -167,3 +163,4 @@ DROP EVENT event44331_1;
DROP EVENT event44331_2;
DROP EVENT event44331_3;
DROP EVENT event44331_4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
index 137253e68c0..e5e690bdf52 100644
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
***********************************************************
***********************************************************
@@ -90,7 +86,7 @@ f1 f2 f3 f4
27 27 27 next
29 29 29 second
30 30 30 next
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
***** Testing Altering table def scenario *****
@@ -427,7 +423,7 @@ f1 f2 f3 f4
** Check slave status **
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
****************************************
* columns in master at middle of table *
@@ -463,10 +459,8 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
*** Drop t10 ***
DROP TABLE t10;
@@ -501,10 +495,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
*** Drop t11 ***
DROP TABLE t11;
@@ -615,7 +607,8 @@ c1 c3 hex(c4) c5 c6
************
* Bug30415 *
************
-Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+include/wait_for_slave_sql_error.inc [errno=1091]
+Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
RESET SLAVE;
@@ -663,7 +656,8 @@ c1 hex(c4) c5 c6 c7 c2
*** Expect slave to fail with Error 1054 ***
********************************************
-Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+include/wait_for_slave_sql_error.inc [errno=1054]
+Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
STOP SLAVE;
RESET SLAVE;
@@ -711,7 +705,8 @@ c1 hex(c4) c5 c6 c7
*** BUG 30434 ***
*****************
-Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+include/wait_for_slave_sql_error.inc [errno=1072]
+Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
STOP SLAVE;
RESET SLAVE;
@@ -875,4 +870,4 @@ c1 hex(c4) c5
2 6231623162316231 JOE
3 6231623162316231 QA
DROP TABLE t5;
-
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
index d55a6bcbbf2..9247ceb1030 100644
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
***********************************************************
***********************************************************
@@ -90,7 +86,7 @@ f1 f2 f3 f4
27 27 27 next
29 29 29 second
30 30 30 next
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
***** Testing Altering table def scenario *****
@@ -427,7 +423,7 @@ f1 f2 f3 f4
** Check slave status **
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
****************************************
* columns in master at middle of table *
@@ -463,10 +459,8 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
*** Drop t10 ***
DROP TABLE t10;
@@ -501,10 +495,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
*** Drop t11 ***
DROP TABLE t11;
@@ -615,7 +607,8 @@ c1 c3 hex(c4) c5 c6
************
* Bug30415 *
************
-Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+include/wait_for_slave_sql_error.inc [errno=1091]
+Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
RESET SLAVE;
@@ -663,7 +656,8 @@ c1 hex(c4) c5 c6 c7 c2
*** Expect slave to fail with Error 1054 ***
********************************************
-Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+include/wait_for_slave_sql_error.inc [errno=1054]
+Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
STOP SLAVE;
RESET SLAVE;
@@ -711,7 +705,8 @@ c1 hex(c4) c5 c6 c7
*** BUG 30434 ***
*****************
-Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+include/wait_for_slave_sql_error.inc [errno=1072]
+Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
STOP SLAVE;
RESET SLAVE;
@@ -875,4 +870,4 @@ c1 hex(c4) c5
2 6231623162316231 JOE
3 6231623162316231 QA
DROP TABLE t5;
-
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
index 3f2256a65e0..c63ba401085 100644
--- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
@@ -1,10 +1,7 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
**** Diff Table Def Start ****
*** On Slave ***
STOP SLAVE;
@@ -57,7 +54,8 @@ a b c
3 4 QA TESTING
*** Start Slave ***
START SLAVE;
-Last_SQL_Error = Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
@@ -86,10 +84,8 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
*** Drop t3 ***
DROP TABLE t3;
*** Create t4 on slave ***
@@ -111,10 +107,8 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
*** Drop t4 ***
DROP TABLE t4;
*** Create t5 on slave ***
@@ -136,10 +130,8 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t5 ***
DROP TABLE t5;
*** Create t6 on slave ***
@@ -160,12 +152,11 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t6 ***
+include/rpl_reset.inc
DROP TABLE t6;
-DROP TABLE t6;
-START SLAVE;
**** Diff Table Def End ****
**** Extra Colums Start ****
*** Create t7 on slave ***
@@ -240,6 +231,7 @@ a b c d e f g h i
1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+DROP TABLE t9;
*** Create t10 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -258,10 +250,8 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
*** Drop t10 ***
DROP TABLE t10;
*** Create t11 on slave ***
@@ -282,10 +272,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
*** Drop t11 ***
DROP TABLE t11;
*** Create t12 on slave ***
@@ -442,6 +430,7 @@ c1 c4 c5 c6 c7
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+DROP TABLE t14a;
*** connect to master and drop columns ***
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c4;
@@ -473,6 +462,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
START SLAVE;
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535");
*** Master Data Insert ***
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -495,10 +487,8 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
********************************************
*** Expect slave to fail with Error 1060 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1060]
+Last_SQL_Error = 'Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5''
*** Try to insert in master ****
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
SELECT * FROM t15 ORDER BY c1;
@@ -598,9 +588,8 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
** DROP table t17 ***
DROP TABLE t17;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
index af5d8539b7e..4e483da72e4 100644
--- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
@@ -1,10 +1,7 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
**** Diff Table Def Start ****
*** On Slave ***
STOP SLAVE;
@@ -57,7 +54,8 @@ a b c
3 4 QA TESTING
*** Start Slave ***
START SLAVE;
-Last_SQL_Error = Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
@@ -86,10 +84,8 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
*** Drop t3 ***
DROP TABLE t3;
*** Create t4 on slave ***
@@ -111,10 +107,8 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
*** Drop t4 ***
DROP TABLE t4;
*** Create t5 on slave ***
@@ -136,10 +130,8 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t5 ***
DROP TABLE t5;
*** Create t6 on slave ***
@@ -160,12 +152,11 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t6 ***
+include/rpl_reset.inc
DROP TABLE t6;
-DROP TABLE t6;
-START SLAVE;
**** Diff Table Def End ****
**** Extra Colums Start ****
*** Create t7 on slave ***
@@ -240,6 +231,7 @@ a b c d e f g h i
1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+DROP TABLE t9;
*** Create t10 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -258,10 +250,8 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
*** Drop t10 ***
DROP TABLE t10;
*** Create t11 on slave ***
@@ -282,10 +272,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
*** Drop t11 ***
DROP TABLE t11;
*** Create t12 on slave ***
@@ -442,6 +430,7 @@ c1 c4 c5 c6 c7
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+DROP TABLE t14a;
*** connect to master and drop columns ***
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c4;
@@ -473,6 +462,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
START SLAVE;
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535");
*** Master Data Insert ***
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -495,10 +487,8 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
********************************************
*** Expect slave to fail with Error 1060 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1060]
+Last_SQL_Error = 'Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5''
*** Try to insert in master ****
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
SELECT * FROM t15 ORDER BY c1;
@@ -598,9 +588,8 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
** DROP table t17 ***
DROP TABLE t17;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
index 7210898d521..0d46f78c150 100644
--- a/mysql-test/suite/rpl/r/rpl_failed_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
@@ -1,19 +1,8 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize error Lock wait timeout exceeded; try restarting transaction
-test.t1 optimize status Operation failed
-Warnings:
-Error 1205 Lock wait timeout exceeded; try restarting transaction
OPTIMIZE TABLE non_existing;
Table Op Msg_type Msg_text
test.non_existing optimize Error Table 'test.non_existing' doesn't exist
@@ -23,3 +12,4 @@ a
1
commit;
drop table t1;
+include/rpl_end.inc
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 5f1f72a9a3a..c88dcee9dbc 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
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (id int, a int);
CREATE TABLE t2 (id int, b int);
CREATE TABLE t3 (id int, c int);
@@ -46,86 +42,55 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id
UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1;
UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1;
+call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146");
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
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;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+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''
[on slave]
show tables like 't%';
Tables_in_test (t%)
@@ -149,3 +114,4 @@ id c
3 3
[on master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-test/suite/rpl/r/rpl_flush_logs.result
index 4c3352559c4..4fce91a7234 100644
--- a/mysql-test/suite/rpl/r/rpl_flush_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_flush_logs.result
@@ -1,20 +1,14 @@
-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;
+include/master-slave.inc
+[connection master]
# Test if support 'flush error logs' statement.
flush error logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs' statement.
# Make sure relay logs was not be flushed
# after execute 'flush error logs' statement.
-# Make sure the 'slave-relay-bin.000004' file does not
-# exist before execute 'flush relay logs' statement.
# Test if support 'flush relay logs' statement.
flush relay logs;
-# Check the 'slave-relay-bin.000004' file is created
+# Check the 'slave-relay-bin.000003' file is created
# after executed 'flush relay logs' statement.
# Make sure binary logs was not be flushed
# after execute 'flush relay logs' statement.
@@ -36,20 +30,21 @@ flush engine logs;
flush binary logs;
# Check the 'master-bin.000002' file is created
# after executed 'flush binary logs' statement.
-# Make sure the 'slave-relay-bin.000007' file does not exist
+# Make sure the 'slave-relay-bin.000006' file does not exist
# exist before execute 'flush error logs, relay logs' statement.
# Test if support to combine all kinds of logs into one statement.
flush error logs, relay logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs, relay logs' statement.
-# Check the 'slave-relay-bin.000007' file is created after
+# Check the 'slave-relay-bin.000006' file is created after
# execute 'flush error logs, relay logs' statement.
-# Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
-# files do not exist before execute 'flush error logs, relay logs'
+# Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+# files do not exist before execute 'flush error logs, relay logs'
# statement.
# Test if 'flush logs' statement works fine and flush all the logs.
flush logs;
# Check 'master-bin.000003' is created
# after execute 'flush logs' statement.
-# Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
+# Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
# files are created after execute 'flush logs' statement.
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index 93e74c20e28..931335fb95c 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -1,28 +1,16 @@
-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;
+include/rpl_init.inc [topology=1->2->1]
show variables like 'relay_log%';
Variable_name Value
-relay_log MYSQLD_DATADIR/relay-log
+relay_log
relay_log_index
relay_log_info_file relay-log.info
relay_log_purge ON
relay_log_recovery OFF
relay_log_space_limit 0
-stop slave;
-change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=MASTER_PORT;
-start slave;
-stop slave;
-change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=SLAVE_PORT;
-include/start_slave.inc
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
INSERT INTO t1 VALUE(1);
FLUSH LOGS;
INSERT INTO t1 VALUE(2);
-Checking that both slave threads are running.
-Relay_Log_File relay-log.000003
+include/check_slave_is_running.inc
+Relay_Log_File = 'mysqld-relay-bin.000003'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index 960833b85d8..f778e76adc0 100644
--- a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=INNODB;
CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=INNODB;
SET FOREIGN_KEY_CHECKS=0;
@@ -52,3 +48,4 @@ select count(*) from t1 /* must be zero */;
count(*)
0
drop table t2,t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_free_items.result b/mysql-test/suite/rpl/r/rpl_free_items.result
index 91c1e2aa6e5..416f597aebc 100644
--- a/mysql-test/suite/rpl/r/rpl_free_items.result
+++ b/mysql-test/suite/rpl/r/rpl_free_items.result
@@ -1,10 +1,7 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int);
create table t2 (a int);
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_geometry.result b/mysql-test/suite/rpl/r/rpl_geometry.result
index 9b48dba4f22..7ec119c9ae8 100644
--- a/mysql-test/suite/rpl/r/rpl_geometry.result
+++ b/mysql-test/suite/rpl/r/rpl_geometry.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(a varchar(100),
b multipoint not null,
c varchar(256));
@@ -16,3 +12,4 @@ b geometrycollection default null,
c decimal(10,0));
insert into t2(c) values (null);
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result
index 2adda3cfc18..757ce9bba17 100644
--- a/mysql-test/suite/rpl/r/rpl_get_lock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_lock.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(n int);
insert into t1 values(get_lock("lock",2));
@@ -34,3 +30,4 @@ select is_free_lock(NULL);
is_free_lock(NULL)
NULL
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
index ba7db2d11e3..2997d4eb426 100644
--- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
@@ -1,34 +1,33 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
call mtr.add_suppression("Slave I/O thread .* register on master");
-stop slave;
+include/stop_slave.inc
SET @@global.debug= "+d,'debug_lock.before_get_UNIX_TIMESTAMP'";
-start slave;
+include/start_slave.inc
slave is going to hang in get_master_version_and_clock
+include/rpl_stop_server.inc [server_number=1]
slave is unblocked
SET DEBUG_SYNC='now SIGNAL signal.get_unix_timestamp';
Check network error happened here
+include/wait_for_slave_io_error.inc [errno=1040, 1053, 2002, 2003, 2006, 2013]
set @@global.debug = "-d,'debug_lock.before_get_UNIX_TIMESTAMP'";
-stop slave;
+include/rpl_start_server.inc [server_number=1]
+include/wait_for_slave_param.inc [Slave_IO_Running]
+include/stop_slave.inc
SET @@global.debug= "+d,'debug_lock.before_get_SERVER_ID'";
-start slave;
+include/start_slave.inc
slave is going to hang in get_master_version_and_clock
+include/rpl_stop_server.inc [server_number=1]
slave is unblocked
SET DEBUG_SYNC='now SIGNAL signal.get_server_id';
Check network error happened here
+include/wait_for_slave_io_error.inc [errno=1040, 1053, 2002, 2003, 2006, 2013]
set @@global.debug = "-d,'debug_lock.before_get_SERVER_ID'";
+include/rpl_start_server.inc [server_number=1]
+include/wait_for_slave_param.inc [Slave_IO_Running]
set global debug= '';
-reset master;
-include/stop_slave.inc
-change master to master_port=SLAVE_PORT;
-start slave;
-*** must be having the replicate-same-server-id IO thread error ***
-Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
SET DEBUG_SYNC= 'RESET';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result
index 285d52b7678..4ec8c51a5dc 100644
--- a/mysql-test/suite/rpl/r/rpl_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_grant.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost;
@@ -41,3 +37,4 @@ user host
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*)
0
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
index 05d37dc7d04..d4bdb77ef0b 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -6,19 +6,19 @@ show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.000
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294968;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.000
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.0009999;
Warnings:
-Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
+Warning 1703 The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.000
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294967;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 4294967.000
@@ -30,7 +30,7 @@ reset slave;
set @@global.slave_net_timeout= 5;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 5.001;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.001
@@ -42,7 +42,7 @@ Variable_name Slave_heartbeat_period
Value 4.000
set @@global.slave_net_timeout= 3 /* must be a warning */;
Warnings:
-Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
reset slave;
drop table if exists t1;
set @@global.slave_net_timeout= 10;
@@ -52,10 +52,12 @@ Variable_name Slave_heartbeat_period
Value 0.500
start slave;
create table t1 (f1 int);
+include/check_slave_param.inc [Relay_Log_File]
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.500
A heartbeat has been received by the slave
drop table t1;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
+include/stop_slave.inc
End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
index ecb7c62c488..e0e6df064b9 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
@@ -1,55 +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;
-
-*** Preparing ***
-[on slave]
+include/rpl_init.inc [topology=1->2,1->3]
+include/rpl_connect.inc [creating master]
+include/rpl_connect.inc [creating slave_1]
+include/rpl_connect.inc [creating slave_2]
include/stop_slave.inc
-RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='MASTER_BINLOG';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
include/start_slave.inc
-[on slave1]
-STOP SLAVE;
-RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='MASTER_BINLOG';
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
include/start_slave.inc
-
-*** 2 slaves ***
Slave has received heartbeat event
-Slave1 has received heartbeat event
-Slave has received more heartbeats than Slave1 (1 means 'yes'): 1
+include/assert.inc [slave_1 should have received more heartbeats than slave_2]
-*** Master->data->Slave1->heartbeat->Slave: ***
-[on slave1]
-RESET MASTER;
-[on slave]
+include/rpl_stop_slaves.inc
+include/rpl_change_topology.inc [new topology=1->3->2]
+include/rpl_start_slaves.inc
include/stop_slave.inc
-RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE1_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.2, MASTER_LOG_FILE='SLAVE1_BINLOG';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
-Slave has received heartbeat event
+slave_1 has received heartbeat event
[on master]
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on master', '');
SHOW TABLES;
Tables_in_test
t1
-[on slave1]
+[on slave_2]
SHOW TABLES;
Tables_in_test
t1
-[on slave]
+[on slave_1]
SHOW TABLES;
Tables_in_test
[on master]
-creating updates on master and send to slave1 during 5 second
-[on slave]
-Slave has received heartbeats (1 means 'yes'): 1
+creating updates on master and send to slave_2 during 5 second
+[on slave_1]
+include/assert.inc [slave_1 should have received heartbeats]
*** Clean up ***
DROP TABLE t1;
-
-End of 6.0 test
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
index b54602663d8..93faf37053a 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
*** Preparing ***
include/stop_slave.inc
@@ -20,7 +16,7 @@ RESET SLAVE;
*** Reset slave affect ***
SET @@global.slave_net_timeout=30;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
RESET SLAVE;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
@@ -28,7 +24,7 @@ Slave_heartbeat_period 15.000
*** Default value if slave_net_timeout changed ***
SET @@global.slave_net_timeout=50;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 25.000
@@ -38,19 +34,19 @@ RESET SLAVE;
*** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
Warnings:
-Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
*** Warning if updated slave_heartbeat_timeout > slave_net_timeout ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
RESET SLAVE;
*** CHANGE MASTER statement only updates slave_heartbeat_period ***
SET @@global.slave_net_timeout=20;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
SHOW VARIABLES LIKE 'slave_net_timeout';
Variable_name Value
slave_net_timeout 20
@@ -71,7 +67,7 @@ RESET SLAVE;
SET @@global.slave_net_timeout=500;
SET @@global.slave_net_timeout=200;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20;
include/start_slave.inc
SHOW VARIABLES LIKE 'slave_net_timeout';
Variable_name Value
@@ -86,7 +82,7 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout;
*** Start/stop slave ***
SET @@global.slave_net_timeout=100;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=20;
include/start_slave.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
@@ -98,15 +94,15 @@ Slave_heartbeat_period 20.000
*** Reload slave ***
SET @@global.slave_net_timeout=50;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
-Reload slave
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=30;
+include/rpl_restart_server.inc [server_number=2]
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 30.000
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
*** Disable heartbeat ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.000
@@ -133,50 +129,50 @@ Result
0
*** Min slave_heartbeat_timeout ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.001;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.001
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.0009;
Warnings:
-Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
+Warning 1703 The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.000
RESET SLAVE;
*** Max slave_heartbeat_timeout ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294967;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 4294967.000
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294968;
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=8589935;
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294967296;
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
RESET SLAVE;
*** Misc incorrect values ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='-1';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''-1'' at line 1
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='123abc';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''123abc'' at line 1
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 1
RESET SLAVE;
*** Running slave ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
@@ -189,25 +185,29 @@ include/start_slave.inc
Heartbeat event received
*** Stopped IO thread ***
-STOP SLAVE IO_THREAD;
+include/stop_slave_io.inc
Number of received heartbeat events while io thread stopped: 0
*** Started IO thread ***
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
Heartbeat event received
*** Stopped SQL thread ***
-STOP SLAVE SQL_THREAD;
+include/stop_slave_sql.inc
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
*** Started SQL thread ***
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
Heartbeat event received
*** Stopped SQL thread by error ***
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on slave', NULL);
INSERT INTO t1 VALUES (1, 'on master', NULL);
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
include/stop_slave.inc
DROP TABLE t1;
@@ -220,7 +220,7 @@ BEGIN
UPDATE test.t1 SET a = a + 1 WHERE a < 10;
END|
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
include/start_slave.inc
SET @@global.event_scheduler=1;
Number of received heartbeat events: 0
@@ -233,7 +233,7 @@ RESET SLAVE;
DROP TABLE t1;
DROP TABLE t1;
RESET MASTER;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.5;
include/start_slave.inc
Heartbeat events are received while rotation of relay logs (1 means 'yes'): 1
@@ -242,7 +242,7 @@ SET @@global.slave_compressed_protocol=1;
include/stop_slave.inc
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
SET @@global.slave_compressed_protocol=0;
@@ -251,7 +251,7 @@ SET @@global.slave_compressed_protocol=0;
*** Reset master ***
STOP SLAVE;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
RESET MASTER;
Heartbeat events are received after reset of master (1 means 'yes'): 1
@@ -259,21 +259,17 @@ Heartbeat events are received after reset of master (1 means 'yes'): 1
*** Reload master ***
STOP SLAVE;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
-Reload master
+include/rpl_restart_server.inc [server_number=1]
+include/wait_for_slave_io_to_start.inc
Heartbeat event received
*** Circular replication ***
-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;
+include/rpl_reset.inc
include/stop_slave.inc
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='SLAVE_BINLOG';
+include/rpl_change_topology.inc [new topology=1->2->1]
include/start_slave.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
INSERT INTO t1 VALUES(1, 'on master');
@@ -291,9 +287,6 @@ a b
Heartbeat event received on master
Heartbeat event received on slave
*** Clean up ***
-include/stop_slave.inc
DROP TABLE t1;
-include/stop_slave.inc
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
-
-End of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
index 42de3c459cb..a73c99bd99b 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
*** Heartbeat over SSL ***
include/stop_slave.inc
@@ -23,5 +19,10 @@ Master_SSL_Allowed: Yes
Heartbeat event has received
*** Clean up ***
-
-End of 6.0 test
+include/stop_slave.inc
+CHANGE MASTER TO
+MASTER_SSL=0,
+MASTER_SSL_CA='',
+MASTER_SSL_CERT='',
+MASTER_SSL_KEY='';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result
index 5e37e7a1f5e..07c6db416b4 100644
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result
@@ -1,12 +1,9 @@
-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 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
@@ -33,8 +30,7 @@ SELECT * FROM t2 ORDER BY a;
a
-3
-1
-Last_SQL_Error
-0
+include/check_slave_no_error.inc
INSERT IGNORE INTO t1 VALUES (-2);
INSERT IGNORE INTO t1 VALUES (-2);
SELECT * FROM t1 ORDER BY a;
@@ -47,8 +43,7 @@ a
-3
-2
-1
-Last_SQL_Error
-0
+include/check_slave_no_error.inc
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
@@ -71,7 +66,7 @@ SELECT * FROM t2 ORDER BY a;
a
-3
1
-Last_SQL_Error
-0
+include/check_slave_no_error.inc
DROP TABLE t1, t2;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index 5169cc8e888..ae6d6ddfc8d 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
@@ -35,3 +31,4 @@ flush privileges;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_revoke.result b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
index b1ccd2f0442..84e1a3b40c7 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;
@@ -28,3 +24,4 @@ Y
revoke select on *.* FROM 'user_foo';
delete from mysql.user where user="user_foo";
delete from mysql.user where user="user_foo";
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index d06dda66267..e5f39655c8d 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
**** Test case for BUG#16487 ****
**** Master ****
CREATE TABLE test.t4 (a int);
@@ -117,6 +113,7 @@ 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';
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032");
drop table t1, mysqltest2.t2;
drop table t4;
drop database mysqltest2;
@@ -142,3 +139,4 @@ HEX(word)
SELECT * FROM tmptbl504451f4258$1;
ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist
DROP TABLE t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table_update.result b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
index a88a3c690ed..c3882d0b98f 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
use test;
drop table if exists mysqltest_foo;
drop table if exists mysqltest_bar;
@@ -21,3 +17,4 @@ n m k
4 15 55
drop table mysqltest_foo,mysqltest_bar,t1;
drop table mysqltest_foo,mysqltest_bar,t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index 6c226aaf2f7..d528fb3297a 100644
--- a/mysql-test/suite/rpl/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -19,7 +15,9 @@ a
2
3
4
-Last_SQL_Error = The incident LOST_EVENTS occured on the master. Message: <none>
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
+include/wait_for_slave_sql_error.inc [errno=1590]
+Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: <none>'
**** On Slave ****
SELECT * FROM t1;
a
@@ -34,5 +32,6 @@ a
2
3
4
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 908abf56c1f..fcf7114879c 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
set global max_connections=151;
include/stop_slave.inc
include/start_slave.inc
@@ -25,6 +21,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
-include/stop_slave.inc
set global init_connect= @my_global_init_connect;
set global max_connections= default;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
index c6ee82b13f3..a185afc5af2 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
@@ -1,19 +1,19 @@
-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;
+include/master-slave.inc
+[connection master]
stop slave;
reset slave;
SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
-Reporting the following error: Failed during slave thread initialization
-call mtr.add_suppression("Failed during slave I/O thread initialization");
+include/wait_for_slave_sql_error.inc [errno=1593]
+Last_SQL_Error = 'Failed during slave thread initialization'
+call mtr.add_suppression("Failed during slave.* thread initialization");
SET GLOBAL debug= "";
-stop slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
-Reporting the following error: Slave SQL thread aborted. Can't execute init_slave query
+include/wait_for_slave_sql_error.inc [errno=1064]
+Last_SQL_Error = 'Slave SQL thread aborted. Can't execute init_slave query'
SET GLOBAL init_slave= "";
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
index 6ad22c368b4..f8734b48295 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
use test;
CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
@@ -140,3 +136,4 @@ DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.bykey_tbl;
DROP TABLE test.byrange_tbl;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
index abff02b4b07..d06e6681e81 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
use test;
CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
@@ -33,3 +29,4 @@ END|
CALL test.proc_norm();
DROP PROCEDURE test.proc_norm;
DROP TABLE test.regular_tbl;
+include/rpl_end.inc
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 549842198e8..36294a4333b 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==========MASTER==========
show global variables like 'binlog_format%';
Variable_name Value
@@ -157,3 +153,4 @@ master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index2 on t2 (d)
master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d)
master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d
drop database test_rpl;
+include/rpl_end.inc
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 818a883a602..d89bce479e5 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==========MASTER==========
show global variables like 'binlog_format%';
Variable_name Value
@@ -1102,3 +1098,4 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid # # COMMIT /* XID */
drop database test_rpl;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert.result b/mysql-test/suite/rpl/r/rpl_insert.result
index 6080d18c5aa..b8e5bfad5d5 100644
--- a/mysql-test/suite/rpl/r/rpl_insert.result
+++ b/mysql-test/suite/rpl/r/rpl_insert.result
@@ -1,12 +1,8 @@
#
# Bug#20821: INSERT DELAYED fails to write some rows to binlog
#
-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;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
CREATE TABLE t1 (id INT, name VARCHAR(64)) ENGINE=MyISAM;
@@ -21,3 +17,4 @@ COUNT(*)
#
USE test;
DROP SCHEMA mysqlslap;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_duplicate.result b/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
new file mode 100644
index 00000000000..61ebbaaa5a9
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
@@ -0,0 +1,29 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=innodb;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=innodb;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
+drop table t1, t2;
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=myisam;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
+drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index f8a8e9eed32..05ef04e8a1d 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
@@ -1,21 +1,14 @@
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
#
# Setup
#
-use test;
-drop table if exists t1, t2, t3;
#
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
#
# We also check how the foreign_key_check variable is replicated
#
-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;
+include/master-slave.inc
+[connection master]
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
create table t1(a int auto_increment, key(a)) engine=myisam;
@@ -534,4 +527,4 @@ drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
set @@session.sql_auto_is_null=default;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
index 79815355332..c2d6d2c9b0c 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(a int auto_increment, primary key(a));
create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
@@ -74,3 +70,4 @@ SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
Got one of the listed errors
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index e3e85c5e4c4..04b64359126 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
@@ -25,47 +21,36 @@ INSERT INTO t2 VALUES (4, 3);
INSERT INTO t2 VALUES (5, 4);
INSERT INTO t2 VALUES (6, 6);
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-drop table t1;
+include/assert.inc [Count of elements in t1 should be 6.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+include/assert.inc [Count of elements in t1 should be 6.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+drop table t1, t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
unique (b)
) ENGINE=myisam;
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (3, 3);
-INSERT INTO t1 VALUES (4, 4);
+CREATE TABLE t2 (
+a int unsigned, # to force INSERT SELECT to have a certain order
+b int unsigned
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 4);
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 5);
+INSERT INTO t2 VALUES (4, 3);
+INSERT INTO t2 VALUES (5, 4);
+INSERT INTO t2 VALUES (6, 6);
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+include/assert.inc [Count of elements in t1 should be 6.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
+include/assert.inc [Count of elements in t1 should be 6.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result
index 1aff39e0026..d98ae2538fa 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_select.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_select.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (n int not null primary key);
insert into t1 values (1);
create table t2 (n int);
@@ -15,3 +11,4 @@ n
1
2
drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result
index be9169c785b..514483e7995 100644
--- a/mysql-test/suite/rpl/r/rpl_invoked_features.result
+++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
USE test;
DROP VIEW IF EXISTS v1,v11;
DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
@@ -447,3 +443,4 @@ DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e11;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix.result b/mysql-test/suite/rpl/r/rpl_ip_mix.result
index ddd7a008a97..4d3999549b3 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix.result
@@ -63,6 +63,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix2.result b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
index e1011bf85ee..3f536fc3efd 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix2.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
@@ -63,6 +63,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
index 0393cfa483c..e1a0c6d4772 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
@@ -105,6 +105,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result
index 6ae946d197b..04f0727b87f 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv6.result
@@ -60,6 +60,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
index c3cde16b9d2..a02c9b599bf 100644
--- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
@@ -59,62 +55,62 @@ CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
[on master1]
CREATE DATABASE d2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP DATABASE d1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP DATABASE IF EXISTS d2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (2);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP EVENT e1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP EVENT IF EXISTS e2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
ALTER FUNCTION f1 SQL SECURITY INVOKER;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP FUNCTION f1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE PROCEDURE p2 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t2;
END;
//
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP PROCEDURE p1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE TABLE t2 (b int);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
ALTER TABLE t1 ADD (d int);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
RENAME TABLE t3 TO t4;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE INDEX i2 on t1 (a);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP INDEX i1 on t1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE TABLE IF NOT EXISTS t4 (a int);
CREATE TRIGGER tr2 BEFORE INSERT ON t4
FOR EACH ROW BEGIN
@@ -122,28 +118,28 @@ DELETE FROM t1 WHERE a=NEW.a;
END;
//
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TRIGGER tr1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TRIGGER IF EXISTS tr2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP VIEW v1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP VIEW IF EXISTS v2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TABLE t1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TABLE IF EXISTS t2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
@@ -168,3 +164,4 @@ DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index daefee9c669..43f5c082dea 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b));
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
@@ -11,14 +7,18 @@ SELECT * FROM t1;
a b
1 10
2 2
-Last_SQL_Error = Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'
+call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
+include/wait_for_slave_sql_error.inc [errno=1105]
+Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10''
SELECT * FROM t1;
a b
stop slave;
+include/wait_for_slave_to_stop.inc
reset slave;
reset master;
drop table t1;
start slave;
+include/wait_for_slave_to_start.inc
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
field_1 int(10) unsigned NOT NULL,
@@ -56,12 +56,16 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
-Last_SQL_Error = Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1 (field_1, field_2, field_3)
+include/wait_for_slave_sql_error.inc [errno=1105]
+Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
-t1.field_3 = t2.field_c'
+t1.field_3 = t2.field_c''
SELECT * FROM t1;
id field_1 field_2 field_3
drop table t1, t2;
drop table t1, t2;
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index 32ec2e624e2..621f3a1ddf5 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -1,10 +1,5 @@
-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;
-reset master;
+include/master-slave.inc
+[connection master]
select last_insert_id();
last_insert_id()
0
@@ -32,32 +27,29 @@ drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-set global sql_slave_skip_counter=1;
-start slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+include/check_slave_no_error.inc
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-stop slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -80,18 +72,14 @@ 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'
+include/wait_for_slave_sql_error.inc [errno=0]
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/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
-DROP TABLE IF EXISTS 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;
+DROP TABLE t1;
+include/rpl_reset.inc
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -112,15 +100,10 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection
use b48297_db1;
-Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
+include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
-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;
+include/rpl_reset.inc
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -132,3 +115,4 @@ Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index e0971b84e3d..6b60bffa365 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a varchar(10) character set utf8);
load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
@@ -76,3 +72,4 @@ E4B880E4BA8CE4B889
E59B9BE4BA94E585AD
E4B883E585ABE4B99D
DROP DATABASE mysqltest;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index 9acc1ad93ac..b13e2ced183 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -1,14 +1,10 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,10);
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Fatal error: Not enough memory
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1593]
+Last_SQL_Error = 'Fatal error: Not enough memory'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 4639c717cea..c34021b1fef 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest;
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
@@ -38,3 +34,4 @@ COUNT(*)
2
DROP DATABASE mysqltest;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result
index 0588ae657ab..38e553e0117 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Create a big file ====
==== Load our big file into a table ====
create table t2 (id int not null primary key auto_increment);
@@ -31,3 +27,4 @@ count(*)
==== Clean up ====
[on master]
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 779a3af9631..351c5b584c5 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
reset master;
create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
@@ -13,3 +9,4 @@ count(*)
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
drop table test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 5e3923616ed..24a1a35470d 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word;
@@ -151,3 +147,4 @@ Abernathy
aberrant
aberration
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result b/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
index c7806f5ecce..c3b3c2232a6 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
select * from t1;
@@ -15,3 +11,4 @@ a b
1 10
2 15
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index 6dccaa3d74c..902bc1cda00 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(a int);
select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
@@ -78,7 +74,50 @@ LOAD/*!99999 special comments that do not expand */DATA/*!99999 code from the fu
SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
[slave]
+
+Bug #59267:
+"LOAD DATA LOCAL INFILE not executed on slave with SBR"
+
+[master]
+SELECT * INTO OUTFILE 'MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+SELECT 'Master', COUNT(*) FROM t1;
+Master COUNT(*)
+Master 44
+[slave]
+SELECT 'Slave', COUNT(*) FROM t1;
+Slave COUNT(*)
+Slave 44
[master]
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
[slave]
+
+Bug #60580/#11902767:
+"statement improperly replicated crashes slave sql thread"
+
+[master]
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+CREATE TABLE t3 AS SELECT * FROM t2;
+CREATE VIEW v1 AS SELECT * FROM t2
+WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+SELECT 1 INTO OUTFILE 'MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+SELECT * FROM t1;
+f1 f2
+NULL NULL
+[slave]
+SELECT * FROM t1;
+f1 f2
+NULL NULL
+[master]
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+[slave]
+include/rpl_end.inc
+# End of 5.1 tests
diff --git a/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 22f65c0b5e5..640d1f72bf5 100644
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@@ -225,11 +221,7 @@ aberration
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (t text);
@@ -240,6 +232,7 @@ END|
include/stop_slave.inc
CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data');
include/start_slave.inc
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
DROP PROCEDURE p;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_locale.result b/mysql-test/suite/rpl/r/rpl_locale.result
index b7396084663..1f6bd40cd16 100644
--- a/mysql-test/suite/rpl/r/rpl_locale.result
+++ b/mysql-test/suite/rpl/r/rpl_locale.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (s1 char(10));
set lc_time_names= 'de_DE';
insert into t1 values (date_format('2001-01-01','%W'));
@@ -18,3 +14,4 @@ s1
Montag
Monday
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 7eec839e7cb..b8bf8b447d2 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -1,11 +1,5 @@
-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 if not exists t1 (n int);
-drop table t1;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
call mtr.add_suppression ("Error in Log_event::read_log_event");
show master status;
@@ -13,9 +7,11 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
+Read_Master_Log_Pos = '75'
start slave;
-Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event'
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
+include/stop_slave_sql.inc
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
@@ -32,3 +28,4 @@ n
3
drop table t1;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
index 9061abca477..23238d9c97b 100644
--- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
+++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
@@ -1,21 +1,18 @@
-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;
+include/master-slave.inc
+[connection master]
FLUSH LOGS;
CREATE TABLE t1(c1 INT);
FLUSH LOGS;
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
-Last_IO_Error
-Got fatal error 1236 from master when reading data from binary log: 'could not find next log'
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log''
CREATE TABLE t2(c1 INT);
FLUSH LOGS;
CREATE TABLE t3(c1 INT);
FLUSH LOGS;
CREATE TABLE t4(c1 INT);
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
SHOW TABLES;
Tables_in_test
t1
@@ -23,3 +20,4 @@ t2
t3
t4
DROP TABLE t1, t2, t3, t4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_many_optimize.result b/mysql-test/suite/rpl/r/rpl_many_optimize.result
index b2148892591..53be9b48c7b 100644
--- a/mysql-test/suite/rpl/r/rpl_many_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_many_optimize.result
@@ -1,9 +1,6 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2);
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index edcae6e7506..bf4347757f7 100644
--- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
select master_pos_wait('master-bin.999999',0,2);
master_pos_wait('master-bin.999999',0,2)
-1
@@ -22,3 +18,4 @@ show slave status;
select master_pos_wait('foo', 98);
master_pos_wait('foo', 98)
NULL
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index 8e39aa0135a..61006ecd714 100644
--- a/mysql-test/suite/rpl/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
insert into t1 values(1, connection_id(), 0, 0, "");
@@ -54,3 +50,4 @@ DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mix_found_rows.result b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
index a3bc1934a70..40e80e23047 100644
--- a/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialize ====
**** On Master ****
CREATE TABLE t1 (a INT);
@@ -136,3 +132,4 @@ DROP PROCEDURE just_log;
DROP PROCEDURE log_me;
DROP PROCEDURE log_me_inner;
DROP FUNCTION log_rows;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
index ecc2987576c..0074d69ba15 100644
--- a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@ -60,3 +56,4 @@ drop table t1;
FLUSH LOGS;
FLUSH LOGS;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
index 1ad34fbe961..14ed79680f1 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
@@ -1,10 +1,10 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,13 +15,11 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
Got one of the listed errors
*** Single statement on non-transactional table ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
*** Single statement on both transactional and non-transactional tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
@@ -38,7 +36,7 @@ Got one of the listed errors
BEGIN;
Got one of the listed errors
Got one of the listed errors
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
@@ -50,7 +48,7 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
@@ -64,7 +62,7 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
@@ -88,7 +86,7 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
@@ -103,7 +101,7 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
@@ -118,7 +116,45 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1197]
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -126,8 +162,6 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-Warnings:
-Note 1051 Unknown table 't6'
+DROP TABLE t5;
DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result b/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
index f1b0b2ae5cb..2b5b31201cb 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
CREATE TABLE t1 (`bit_key` bit, `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
CREATE TABLE t2 (`bit_key` bit(4), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
@@ -30,3 +26,4 @@ DELETE FROM `t7` WHERE `bit` < 2 LIMIT 4;
INSERT INTO `t8` ( `bit` ) VALUES ( 0 );
DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4;
DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
+include/rpl_end.inc
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 38806e2b66d..f24f34fa0bf 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
@@ -17,6 +13,7 @@ Server_id Host Port Master_id
2 127.0.0.1 9999 1
drop table t1;
stop slave;
+include/wait_for_slave_to_stop.inc
create table t2(id int auto_increment primary key, created datetime);
SET TIME_ZONE= '+03:00';
set timestamp=12345;
@@ -28,6 +25,7 @@ create table t3 like t2;
create temporary table t4 like t2;
create table t5 select * from t4;
start slave;
+include/wait_for_slave_to_start.inc
select * from t2;
id created
1 1970-01-01 06:25:45
@@ -45,3 +43,4 @@ t5 CREATE TABLE `t5` (
`created` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2,t3,t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
index b749778bcc2..541234fb5af 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -1563,3 +1559,4 @@ DROP TABLE IF EXISTS nt_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
SET @commands= '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
index 7a5c6533641..baeefe7c6ea 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
@@ -1,10 +1,5 @@
-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 session storage_engine=innodb;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -525,10 +520,8 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db
###################################################################################
# CHECK CONSISTENCY
###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
+include/diff_tables.inc [master:tt_1,slave:tt_1]
###################################################################################
# CLEAN
###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
index 5e42ca3d6da..5982d439a3e 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11561,3 +11557,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_delete.result b/mysql-test/suite/rpl/r/rpl_multi_delete.result
index 4831502eb88..ea1d87a3960 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_delete.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int primary key);
create table t2 (a int);
insert into t1 values (1);
@@ -20,3 +16,4 @@ select * from t2;
a
1
drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_delete2.result b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
index 8e6a6a3d4d0..c693a43a550 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_delete2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
set sql_log_bin=0;
create database mysqltest_from;
set sql_log_bin=1;
@@ -42,3 +38,4 @@ set sql_log_bin=0;
drop database mysqltest_from;
set sql_log_bin=1;
drop database mysqltest_to;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index e26777c15ce..7815fa88c93 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
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
@@ -360,3 +356,4 @@ 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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result
index 524278be042..8634e86afed 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
@@ -25,3 +21,4 @@ a b
2 1
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result
index 5bb262764fa..a3cab693322 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update2.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1,t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
@@ -53,3 +49,4 @@ select * from t1;
a
3
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result
index dba7f770ba2..6b9ec5c3947 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update3.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update3.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
-------- Test for BUG#9361 --------
CREATE TABLE t1 (
@@ -195,3 +191,4 @@ idpro price nbprice
2 1.0000 2
3 2.0000 1
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update4.result b/mysql-test/suite/rpl/r/rpl_multi_update4.result
index f6dde65a35d..0c4857bed60 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update4.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update4.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists d1;
drop database if exists d2;
drop database if exists d2;
@@ -23,3 +19,4 @@ id
0
drop database d1;
drop database d2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
index 26c3e545293..632529ce2b9 100644
--- a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
+++ b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
@@ -1,14 +1,12 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
Master position is not changed
STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
Master position has been changed
DROP DATABASE `mysqltest-1`;
DROP DATABASE `#mysql50#mysqltest-1`;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_name_const.result b/mysql-test/suite/rpl/r/rpl_name_const.result
index acb2684d2c8..89a48bad09b 100644
--- a/mysql-test/suite/rpl/r/rpl_name_const.result
+++ b/mysql-test/suite/rpl/r/rpl_name_const.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
create table t1 (id int);
@@ -26,3 +22,4 @@ id
[on master]
drop table t1;
drop procedure test_procedure;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
index 1f62ea7b100..9a72eba851f 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11933,3 +11929,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
index 7390d5fd316..4106dc93198 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -13801,3 +13797,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
index 213a50f97ac..21031190660 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11123,3 +11119,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result b/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
index 1b7ac567936..ebbc657fcfd 100644
--- a/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
CREATE TABLE t1 (a VARCHAR(1000));
INSERT INTO t1 VALUES (CONNECTION_ID());
@@ -23,5 +19,6 @@ INSERT INTO t1 VALUES
(UTC_TIMESTAMP());
INSERT INTO t1 VALUES (RAND());
INSERT INTO t1 VALUES (LAST_INSERT_ID());
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
index b09fbab905a..1eaeaba05bb 100644
--- a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -45,8 +41,8 @@ INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
SELECT * FROM t3 ORDER BY a;
a b
@@ -80,7 +76,7 @@ UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
DROP TABLE t1;
DROP TABLE t2;
@@ -122,7 +118,7 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
@@ -200,3 +196,4 @@ a b c
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
index 09611dc6480..ec17e3bfafa 100644
--- a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -45,8 +41,8 @@ INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
SELECT * FROM t3 ORDER BY a;
a b
@@ -80,7 +76,7 @@ UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
DROP TABLE t1;
DROP TABLE t2;
@@ -122,7 +118,7 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
@@ -200,3 +196,4 @@ a b c
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 542e9dfd6cb..b606e47a55f 100644
--- a/mysql-test/suite/rpl/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
@@ -1,10 +1,5 @@
-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;
-drop tables if exists t1;
+include/master-slave.inc
+[connection master]
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (a) SELECT null FROM t1;
@@ -26,3 +21,4 @@ optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 1ec9259a1fb..6190f458367 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
@@ -33,22 +29,15 @@ include/stop_slave.inc
include/start_slave.inc
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-Slave_IO_Running = No (expect No)
-SELECT "Got a packet bigger than 'max_allowed_packet' bytes" AS Last_IO_Error;
-Last_IO_Error
-Got a packet bigger than 'max_allowed_packet' bytes
-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;
+include/wait_for_slave_io_error.inc [errno=1153]
+Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes'
+include/stop_slave_sql.inc
+include/rpl_reset.inc
+DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
-Slave_IO_Running = No (expect No)
-SELECT "Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'" AS Last_IO_Error;
-Last_IO_Error
-Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
@@ -60,5 +49,9 @@ SET @max_allowed_packet_2= @@session.max_allowed_packet;
==== clean up ====
DROP TABLE t1;
SET @@global.max_allowed_packet= 1024;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.net_buffer_length= 1024;
DROP TABLE t1;
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_plugin_load.result b/mysql-test/suite/rpl/r/rpl_plugin_load.result
index 43e171a97c9..b33e29ef668 100644
--- a/mysql-test/suite/rpl/r/rpl_plugin_load.result
+++ b/mysql-test/suite/rpl/r/rpl_plugin_load.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
@@ -33,4 +29,5 @@ Delta
Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+include/rpl_end.inc
End of test
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index 89e822b3eb6..ca46f373610 100644
--- a/mysql-test/suite/rpl/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
create table t1(n char(30));
prepare stmt1 from 'insert into t1 values (?)';
@@ -26,6 +22,7 @@ from-master-2-'',
from-var-from-master-3
drop table t1;
stop slave;
+include/wait_for_slave_to_stop.inc
########################################################################
#
@@ -33,49 +30,22 @@ stop slave;
# statement breaks binlog.
#
########################################################################
-
# Connection: slave
-
-
START SLAVE;
-
# Connection: master
-
-
CREATE DATABASE mysqltest1;
CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32));
-
PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)';
-
EXECUTE stmt_d_1;
-
use mysqltest1;
-
EXECUTE stmt_d_1;
-
-
# Connection: slave
-
-
SELECT * FROM t1;
db_name db_col_name
test latin1_swedish_ci
test latin1_swedish_ci
-
# Connection: master
-
-
DROP DATABASE mysqltest1;
-
use test;
DROP TABLE t1;
-
-
-# Connection: slave
-
-
-STOP SLAVE;
-
-########################################################################
-reset master;
-reset slave;
+include/rpl_end.inc
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 7f43869c3b7..e41c16110dc 100644
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
@@ -30,3 +26,4 @@ slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
DROP TABLE IF EXISTS t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result
index 971b20fcf3a..2f1f8cc1efb 100644
--- a/mysql-test/suite/rpl/r/rpl_read_only.result
+++ b/mysql-test/suite/rpl/r/rpl_read_only.result
@@ -1,10 +1,6 @@
-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("Unsafe statement written to the binary log in statement format since BINLOG_FORMAT = STATEMENT");
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create user test;
create table t1(a int) engine=InnoDB;
create table t2(a int) engine=MyISAM;
@@ -31,15 +27,26 @@ a
2001
set global read_only=0;
BEGIN;
+BEGIN;
+select @@read_only;
+@@read_only
+0
+set global read_only=1;
+*** On SUPER USER connection ***
insert into t1 values(1002);
insert into t2 values(2002);
-BEGIN;
+*** On regular USER connection ***
insert into t1 values(1003);
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2003);
-set global read_only=1;
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+*** SUPER USER COMMIT (must succeed) ***
COMMIT;
+*** regular USER COMMIT (must succeed - nothing to commit) ***
COMMIT;
-ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+select @@read_only;
+@@read_only
+1
set global read_only=0;
insert into t1 values(1004);
insert into t2 values(2004);
@@ -52,7 +59,6 @@ select * from t2;
a
2001
2002
-2003
2004
select * from t1;
a
@@ -63,7 +69,6 @@ select * from t2;
a
2001
2002
-2003
2004
set global read_only=1;
select @@read_only;
@@ -91,7 +96,6 @@ select * from t2;
a
2001
2002
-2003
2004
2005
select * from t1;
@@ -104,7 +108,6 @@ select * from t2;
a
2001
2002
-2003
2004
2005
insert into t1 values(1006);
@@ -115,3 +118,4 @@ drop user test;
drop table t1;
drop table t2;
set global read_only=0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
index 54aac2eca35..4f10ac50f9a 100644
--- a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SHOW VARIABLES LIKE 'relay_log_space_limit';
Variable_name Value
relay_log_space_limit 0
@@ -23,3 +19,4 @@ Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
index e8d2d63e46e..4c1a50b2f33 100644
--- a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SHOW VARIABLES LIKE 'relay_log_space_limit';
Variable_name Value
relay_log_space_limit 0
@@ -23,3 +19,4 @@ Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relayrotate.result b/mysql-test/suite/rpl/r/rpl_relayrotate.result
index 20f19973d83..ea00aee0085 100644
--- a/mysql-test/suite/rpl/r/rpl_relayrotate.result
+++ b/mysql-test/suite/rpl/r/rpl_relayrotate.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
stop slave;
create table t1 (a int) engine=innodb;
reset slave;
@@ -14,3 +10,4 @@ select max(a) from t1;
max(a)
8000
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result
index bb4e672e7e5..fb21540aa31 100644
--- a/mysql-test/suite/rpl/r/rpl_relayspace.result
+++ b/mysql-test/suite/rpl/r/rpl_relayspace.result
@@ -1,19 +1,15 @@
-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;
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
create table t1 (a int);
drop table t1;
create table t1 (a int);
drop table t1;
reset slave;
start slave io_thread;
-stop slave io_thread;
+include/wait_for_slave_param.inc [Slave_IO_State]
+include/stop_slave_io.inc
reset slave;
-start slave;
-select master_pos_wait('MASTER_LOG_FILE',200,30)=-1;
-master_pos_wait('MASTER_LOG_FILE',200,30)=-1
-0
+include/start_slave.inc
+include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index 637047a883b..6f85fc15b1e 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t11;
drop table if exists t11;
create table t2 (n int);
@@ -26,7 +22,7 @@ n
select * from t11;
ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11;
-Replicate_Do_Table test.t1
+Replicate_Do_Table = 'test.t1'
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
@@ -73,3 +69,4 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
*** master ***
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
index 0135804c02d..f0c46b0b966 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
drop database if exists mysqltest2;
create database mysqltest1;
@@ -21,3 +17,4 @@ a
1
drop database mysqltest1;
drop database mysqltest2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_report.result b/mysql-test/suite/rpl/r/rpl_report.result
index e129d7c8f22..b979d1faf5d 100644
--- a/mysql-test/suite/rpl/r/rpl_report.result
+++ b/mysql-test/suite/rpl/r/rpl_report.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
select * from Information_schema.GLOBAL_VARIABLES where variable_name like 'report_host';
VARIABLE_NAME VARIABLE_VALUE
REPORT_HOST 127.0.0.1
@@ -31,3 +27,4 @@ Value my_password
set @@global.report_host='my.new.address.net';
ERROR HY000: Variable 'report_host' is a read only variable
end of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index dae72d83b51..12071faecfd 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -219,3 +215,4 @@ DROP DATABASE database_slave_temp_01;
DROP DATABASE database_slave_temp_02;
DROP DATABASE database_slave_temp_03;
SET sql_log_bin= 1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index f529170d05e..279ab88bde3 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -1,5 +1,3 @@
-drop table if exists t1, t2, t3, t4;
-drop table if exists t1, t2, t3, t4;
start slave;
Got one of the listed errors
start slave;
@@ -10,13 +8,14 @@ reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master;
start slave;
+include/wait_for_slave_to_start.inc
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
-Master_Log_File master-bin.000001
-Relay_Master_Log_File master-bin.000001
-Checking that both slave threads are running.
+Master_Log_File = 'master-bin.000001'
+Relay_Master_Log_File = 'master-bin.000001'
+include/check_slave_is_running.inc
select * from t1;
s
Could not break slave
@@ -38,8 +37,8 @@ drop table temp_table, t3;
insert into t2 values(1234);
set insert_id=1234;
insert into t2 values(NULL);
-set global sql_slave_skip_counter=1;
-start slave;
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
purge master logs to 'master-bin.000002';
show master logs;
Log_name master-bin.000002
@@ -57,9 +56,9 @@ show binary logs;
Log_name File_size
master-bin.000003 #
insert into t2 values (65);
-Master_Log_File master-bin.000003
-Relay_Master_Log_File master-bin.000003
-Checking that both slave threads are running.
+Master_Log_File = 'master-bin.000003'
+Relay_Master_Log_File = 'master-bin.000003'
+include/check_slave_is_running.inc
select * from t2;
m
34
@@ -91,7 +90,7 @@ a
testing temporary tables part 2
Master_Log_File master-bin.000009
Relay_Master_Log_File master-bin.000009
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
@@ -106,3 +105,4 @@ show binlog events in '';
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
purge master logs before now();
End of 5.0 tests
+include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index 0d682eb82e1..b5f6aea9698 100644
--- a/mysql-test/suite/rpl/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
@@ -53,3 +49,4 @@ SELECT n FROM t1;
n
3456
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_4_bytes.result b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
index e2431364ed3..ef9602204a1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
+++ b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -25,3 +21,4 @@ ABE
ANG
LIL
DROP DATABASE mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_NOW.result b/mysql-test/suite/rpl/r/rpl_row_NOW.result
index 23f95878608..eb6271d6e93 100644
--- a/mysql-test/suite/rpl/r/rpl_row_NOW.result
+++ b/mysql-test/suite/rpl/r/rpl_row_NOW.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create database if not exists mysqltest1;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
@@ -27,3 +23,4 @@ INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result
index 98755fb4653..5298395da20 100644
--- a/mysql-test/suite/rpl/r/rpl_row_USER.result
+++ b/mysql-test/suite/rpl/r/rpl_row_USER.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE USER tester IDENTIFIED BY 'test';
@@ -36,3 +32,4 @@ REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP USER tester@'%';
DROP USER ''@'localhost%';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result
index 02174a7ecae..b7d3f8914e0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_UUID.result
+++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=myisam;
@@ -38,3 +34,4 @@ DROP PROCEDURE test.p1;
DROP FUNCTION test.fn1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
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 1051d907b26..9f973bbe80e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE DATABASE test_ignore;
**** On Master ****
SHOW DATABASES;
@@ -48,11 +44,10 @@ t1
USE test_ignore;
ERROR 42000: Unknown database 'test_ignore'
DROP DATABASE test_ignore;
-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;
+USE test;
+DROP TABLE t1;
+USE test;
+include/rpl_reset.inc
CREATE TABLE t1 (a INT);
DELETE FROM t1;
INSERT INTO t1 VALUES (1),(2);
@@ -67,13 +62,10 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
================ Test for BUG#17620 ================
-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;
+include/rpl_reset.inc
**** On Slave ****
SET GLOBAL QUERY_CACHE_SIZE=0;
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032");
**** On Master ****
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -105,12 +97,9 @@ a
8
9
SET GLOBAL QUERY_CACHE_SIZE=0;
+DROP TABLE t1;
================ Test for BUG#22550 ================
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
INSERT INTO t1 VALUES(1,2);
SELECT HEX(a),b FROM t1;
@@ -128,11 +117,7 @@ HEX(a) b
0 2
DROP TABLE IF EXISTS t1;
================ Test for BUG#22583 ================
-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;
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
@@ -249,13 +234,8 @@ a b
3 1
4 4
drop table t1,t2;
-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;
+include/rpl_reset.inc
**** On Master ****
-SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave'));
INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
**** On Slave ****
@@ -279,6 +259,6 @@ SELECT * FROM t1 ORDER BY a;
a b
2 master,slave
5 slave
-DROP TABLE t1;
**** On Master ****
DROP TABLE t1;
+include/rpl_end.inc
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 350ce0ac2c9..c864850a238 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'MYISAM' ;
SELECT * FROM t1;
C1 C2
@@ -422,11 +418,7 @@ a b c
**** Test for BUG#31552 ****
**** On Master ****
DELETE FROM t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
@@ -436,7 +428,7 @@ DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
set @@global.slave_exec_mode= default;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
@@ -480,47 +472,43 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677");
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
+include/rpl_reset.inc
[expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
drop table t1, t2, t3, t4, t5, t6, t7;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='MYISAM' ;
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
@@ -574,7 +562,7 @@ ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
*** results: t2 must be consistent ****
-Comparing tables master:test.t2 and master:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1, t2;
EOF OF TESTS
CREATE TABLE t1 (a int) ENGINE='MYISAM' ;
@@ -590,7 +578,7 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
CREATE TABLE t1 (a bit) ENGINE='MYISAM' ;
INSERT IGNORE INTO t1 VALUES (NULL);
@@ -632,5 +620,6 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
+include/rpl_end.inc
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 59441ac5684..0e00695500c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ;
SELECT * FROM t1;
C1 C2
@@ -425,11 +421,7 @@ a b c
**** Test for BUG#31552 ****
**** On Master ****
DELETE FROM t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
@@ -439,7 +431,7 @@ DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
set @@global.slave_exec_mode= default;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
@@ -483,47 +475,43 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677");
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
+include/rpl_reset.inc
[expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
drop table t1, t2, t3, t4, t5, t6, t7;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='INNODB' ;
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
@@ -577,7 +565,7 @@ ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
*** results: t2 must be consistent ****
-Comparing tables master:test.t2 and master:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1, t2;
EOF OF TESTS
CREATE TABLE t1 (a int) ENGINE='INNODB' ;
@@ -593,7 +581,7 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
@@ -638,5 +626,6 @@ UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index 3443e704031..c7241c52353 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
SET @@BINLOG_FORMAT = ROW;
SELECT @@BINLOG_FORMAT;
@@ -717,3 +713,4 @@ COUNT(*)
4
DELETE FROM t1;
DROP TABLE IF EXISTS t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
index 6e47f747a79..077199a0c93 100644
--- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
@@ -1,10 +1,10 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,13 +15,11 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
Got one of the listed errors
*** Single statement on non-transactional table ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
*** Single statement on both transactional and non-transactional tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
@@ -39,9 +37,7 @@ Got one of the listed errors
BEGIN;
Got one of the listed errors
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
@@ -53,7 +49,7 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
@@ -67,7 +63,7 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
@@ -91,7 +87,7 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
@@ -106,7 +102,7 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
@@ -121,7 +117,45 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1534]
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -129,10 +163,6 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
-Warnings:
-Note 1051 Unknown table 't4'
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-Warnings:
-Note 1051 Unknown table 't6'
+DROP TABLE t5;
DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
index 055efffbd6a..4fb33dc4b6b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -154,3 +150,4 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
index 055efffbd6a..4fb33dc4b6b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -154,3 +150,4 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result
index 0ef47b8752d..487cddc2051 100644
--- a/mysql-test/suite/rpl/r/rpl_row_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
**** Testing WL#3228 changes. ****
*** Create "wider" table on slave ***
@@ -18,7 +14,8 @@ CREATE TABLE t1 (a DECIMAL(20, 10));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -34,7 +31,8 @@ CREATE TABLE t1 (a DECIMAL(27, 18));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -50,7 +48,8 @@ CREATE TABLE t1 (a NUMERIC(20, 10));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -67,7 +66,8 @@ CREATE TABLE t1 (a FLOAT(47));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -84,7 +84,8 @@ CREATE TABLE t1 (a BIT(64));
RESET MASTER;
INSERT INTO t1 VALUES (B'10101');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -100,7 +101,8 @@ CREATE TABLE t1 (a BIT(12));
RESET MASTER;
INSERT INTO t1 VALUES (B'10101');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -117,7 +119,8 @@ CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9'));
RESET MASTER;
INSERT INTO t1 VALUES ('4');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -134,7 +137,8 @@ CREATE TABLE t1 (a CHAR(20));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -182,7 +186,8 @@ CREATE TABLE t1 (a ENUM(
RESET MASTER;
INSERT INTO t1 VALUES ('44');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -199,7 +204,8 @@ CREATE TABLE t1 (a VARCHAR(2000));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -215,7 +221,8 @@ CREATE TABLE t1 (a VARCHAR(200));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -231,7 +238,8 @@ CREATE TABLE t1 (a VARCHAR(2000));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -248,7 +256,8 @@ CREATE TABLE t1 (a LONGBLOB);
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -256,5 +265,8 @@ STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677");
*** Cleanup ***
DROP TABLE IF EXISTS t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
index 90ccae5d738..b42ff0c3b17 100644
--- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
[on slave]
SET @old_slave_exec_mode= @@global.slave_exec_mode;
@@ -24,14 +20,17 @@ a
1
[on slave]
---- Wait until slave stops with an error ----
+include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error (expected "duplicate key" 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 END_LOG_POS
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
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;
+include/wait_for_slave_sql_to_start.inc
---- Sync slave and verify that there is no error ----
Last_SQL_Error = '' (expected no error)
SELECT * FROM t1;
@@ -51,12 +50,16 @@ 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 983 (expected "can't find record" error)
+call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032");
+include/wait_for_slave_sql_error.inc [errno=1032]
+Last_SQL_Error (expected "duplicate key" 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 END_LOG_POS
SELECT * FROM t1;
a
---- Resolve the conflict on the slave and restart SQL thread ----
INSERT INTO t1 VALUES (1);
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
---- Sync slave and verify that there is no error ----
Last_SQL_Error = (expected no error)
SELECT * FROM t1;
@@ -65,6 +68,7 @@ a
[on master]
DROP TABLE t1;
[on slave]
+include/rpl_reset.inc
######## Run with slave_exec_mode=IDEMPOTENT ########
set @@global.slave_exec_mode= 'IDEMPOTENT';
==== Initialize ====
@@ -108,3 +112,4 @@ a
DROP TABLE t1;
[on slave]
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
index 90b68428008..4575588b1ef 100644
--- a/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
+++ b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(a int not null primary key) engine=myisam;
insert delayed into t1 values (1);
insert delayed into t1 values (2);
@@ -20,3 +16,4 @@ a
2
3
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 402d20e469b..be7b2d16a0b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
@@ -55,3 +51,4 @@ t2
SHOW TABLES;
Tables_in_test
t2
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
index a0b7f74fea4..db38c2d8005 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -1628,3 +1624,4 @@ DROP TABLE IF EXISTS nt_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
SET @commands= '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row.result b/mysql-test/suite/rpl/r/rpl_row_find_row.result
index 69516b47b7d..fff1f1b0c35 100644
--- a/mysql-test/suite/rpl/r/rpl_row_find_row.result
+++ b/mysql-test/suite/rpl/r/rpl_row_find_row.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN=0;
CREATE TABLE t (a int, b int, c int, key(b));
SET SQL_LOG_BIN=1;
@@ -12,27 +8,18 @@ INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
DROP TABLE t;
-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;
+include/rpl_reset.inc
CREATE TABLE t (a int, b int, c int, key(b));
ALTER TABLE t DISABLE KEYS;
INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
DROP TABLE t;
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2));
INSERT INTO t1(c1,c2) VALUES(1,1);
INSERT INTO t1(c1,c2) VALUES(1,2);
UPDATE t1 SET c1=1000 WHERE c2=2;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
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 fe2fb1d9da2..6b8d8b9407e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -1,10 +1,6 @@
-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) ENGINE=MyISAM;
+include/master-slave.inc
+[connection master]
+create table t1 (a int);
insert into t1 values (10);
create table t2 (a int) ENGINE=MyISAM;
create table t3 (a int) engine=merge union(t1);
@@ -21,10 +17,13 @@ flush tables;
select * from t3;
a
stop slave;
+include/wait_for_slave_to_stop.inc
drop table t1;
flush tables with read lock;
start slave;
+include/wait_for_slave_to_start.inc
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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func001.result b/mysql-test/suite/rpl/r/rpl_row_func001.result
index b20f3f724d0..74a053abb26 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func001.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
create table test.t1 (a int, PRIMARY KEY(a));
@@ -28,3 +24,4 @@ a
2
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func002.result b/mysql-test/suite/rpl/r/rpl_row_func002.result
index 03f5b3115c3..69a732048b2 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func002.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -24,3 +20,4 @@ INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
DROP FUNCTION test.f1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func003.result b/mysql-test/suite/rpl/r/rpl_row_func003.result
index 94d01b50ce5..cdc5bf6afba 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func003.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
DROP FUNCTION IF EXISTS test.f1;
DROP TABLE IF EXISTS test.t1;
@@ -28,3 +24,4 @@ ROLLBACK;
SET AUTOCOMMIT=1;
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result
index fcc68cd4712..20afcd0a393 100644
--- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result
@@ -1,12 +1,9 @@
-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 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
set @old_slave_exec_mode= @@global.slave_exec_mode;
set @@global.slave_exec_mode= IDEMPOTENT;
create table ti1 (b int primary key) engine = innodb;
@@ -76,6 +73,7 @@ b
2
3
*** slave must stop (Trying to delete a referenced foreing key)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
@@ -94,6 +92,7 @@ set global slave_exec_mode='STRICT';
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
@@ -114,6 +113,7 @@ a b
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1062
set foreign_key_checks= 0;
@@ -130,6 +130,7 @@ DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -137,6 +138,7 @@ start slave sql_thread;
set global slave_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -146,6 +148,7 @@ UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -153,6 +156,7 @@ start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -161,3 +165,4 @@ SET @@global.slave_exec_mode= @old_slave_exec_mode;
drop table t1,t2,ti2,ti1;
set @@global.slave_exec_mode= @old_slave_exec_mode;
*** end of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
index d9e70ce95c5..f81e5db986e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
@@ -1,10 +1,5 @@
-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 session storage_engine=innodb;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -563,10 +558,8 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db
###################################################################################
# CHECK CONSISTENCY
###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
+include/diff_tables.inc [master:tt_1,slave:tt_1]
###################################################################################
# CLEAN
###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
+include/rpl_end.inc
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 9a179478ecc..fa565c4061c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Setup table on master but not on slave ====
[on master]
CREATE TABLE t1 (a INT);
@@ -14,8 +10,11 @@ DROP TABLE t1;
INSERT INTO t1 VALUES (1);
==== Verify error on slave ====
[on slave]
-Last_SQL_Error = Error executing row event: 'Table 'test.t1' doesn't exist'
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146");
+include/wait_for_slave_sql_error.inc [errno=1146]
==== Clean up ====
-include/stop_slave.inc
+include/stop_slave_io.inc
+RESET SLAVE;
[on master]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
index 5959a82183e..e7f25f9cb0a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@ -58,3 +54,4 @@ a
1
drop table t1;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
index 4b2948f9382..988be2b84d0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
@@ -13,13 +13,8 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
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;
-reset master;
+include/master-slave.inc
+[connection master]
select last_insert_id();
last_insert_id()
0
@@ -47,32 +42,27 @@ drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-set global sql_slave_skip_counter=1;
-start slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+include/check_slave_no_error.inc
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-stop slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -99,13 +89,8 @@ drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
-DROP TABLE IF EXISTS 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;
+DROP TABLE t1;
+include/rpl_reset.inc
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -126,15 +111,10 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection
use b48297_db1;
-Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
+include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
-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;
+include/rpl_reset.inc
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -146,3 +126,4 @@ Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index dbb43b9415b..b9be2cd0144 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -1,13 +1,11 @@
-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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
@@ -243,18 +241,13 @@ slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Table_map # # table_id: # (test.t2)
slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000002 # Query # # COMMIT
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
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;
+include/rpl_reset.inc
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -276,3 +269,4 @@ a b
5 1
6 1
drop table t1;
+include/rpl_end.inc
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 ed6051829d4..15aa8f23b55 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -1,13 +1,11 @@
-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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
insert into t1 values (NULL);
drop table t1;
@@ -243,18 +241,13 @@ slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Table_map # # table_id: # (test.t2)
slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000002 # Xid # # COMMIT /* XID */
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
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;
+include/rpl_reset.inc
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -276,3 +269,4 @@ a b
5 1
6 1
drop table t1;
+include/rpl_end.inc
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 547dd8e1541..379cea4d3fc 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,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
@@ -23,7 +19,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 2
#
@@ -33,7 +29,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 3: max_relay_log_size = 0
#
@@ -43,7 +39,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size 0
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
@@ -57,13 +53,13 @@ reset slave;
start slave;
flush logs;
create table t1 (a int);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
drop table t1;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
@@ -72,3 +68,4 @@ set global max_binlog_size= @my_max_binlog_size;
#
# End of 4.1 tests
#
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
index 7390d5fd316..4106dc93198 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -13801,3 +13797,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 0852d1048f2..9e3577e1d5c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
---Setup Section --
set timestamp=1000000000;
@@ -83,9 +79,11 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
stop slave;
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
--- Test 1 Load from Dump binlog file --
@@ -209,9 +207,11 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
stop slave;
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
SELECT COUNT(*) from t1;
COUNT(*)
352
@@ -337,9 +337,11 @@ ROLLBACK /* added by mysqlbinlog */;
--- Test 8 switch internal charset --
stop slave;
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t4 (f text character set utf8);
create table t5 (f text character set cp932);
flush logs;
@@ -378,3 +380,4 @@ a b
1 1
FLUSH LOGS;
DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
index c461cafbd7c..523564a222e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
@@ -1,46 +1,34 @@
-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;
+include/master-slave.inc
+[connection master]
## case #1 - last_null_bit_pos==0 in record_compare without X bit
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #2 - X bit is wrongly set.
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,2,NULL);
+UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);
+include/diff_tables.inc [master:test.t1, slave:test.t1]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
index 38fbe486d2e..4dc7c0bc7a3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
@@ -1,60 +1,43 @@
-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;
+include/master-slave.inc
+[connection master]
+## coverage purposes - Field_bits
+## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1(c1,c2) VALUES (10, b'1');
+INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
+UPDATE t1 SET c1= 0;
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
## case #1 - last_null_bit_pos==0 in record_compare without X bit
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #2 - X bit is wrongly set.
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
-## coverage purposes - Field_bits
-## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==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 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-INSERT INTO t1(c1,c2) VALUES (10, b'1');
-INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
-UPDATE t1 SET c1= 0;
-Comparing tables master:test.t1 and slave:test.t1
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,2,NULL);
+UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);
+include/diff_tables.inc [master:test.t1, slave:test.t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 5499d41bc1f..7dc94bab481 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -1,22 +1,18 @@
-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;
-Master_User root
-Master_Host 127.0.0.1
+include/master-slave.inc
+[connection master]
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
change master to master_user='test';
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
reset slave;
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
change master to master_user='root';
include/start_slave.inc
-Master_User root
-Master_Host 127.0.0.1
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
@@ -29,13 +25,20 @@ Variable_name Value
Slave_open_temp_tables 0
include/stop_slave.inc
reset slave;
+include/check_slave_no_error.inc
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
change master to master_user='root';
include/start_slave.inc
+include/check_slave_no_error.inc
stop slave;
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
reset slave;
+include/check_slave_no_error.inc
+change master to master_user='root';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
index a05213217b2..7c55e44ed59 100644
--- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
@@ -1,18 +1,12 @@
-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;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'master-bin.000001' 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)
master-bin.000001 # Query # # BEGIN
@@ -27,19 +21,17 @@ master-bin.000001 # Query # # 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 # # COMMIT
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS ********
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)
@@ -55,33 +47,8 @@ master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # 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 # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-bin.000001 # Query # # BEGIN
@@ -96,19 +63,17 @@ slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -124,32 +89,7 @@ slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
@@ -167,42 +107,35 @@ slave-relay-bin.000003 # Query # # BEGIN
slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
-show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 3;
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1,3;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-relay-bin.000003 # Query # # BEGIN
+******** [slave] SHOW RELAYLOG EVENTS ********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
FLUSH LOGS;
FLUSH LOGS;
DROP TABLE t1;
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'master-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [master] SHOW BINLOG EVENTS ********
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)
@@ -218,24 +151,19 @@ master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
-master-bin.000001 # Query # # 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 # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=4
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'slave-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -251,26 +179,25 @@ slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
-slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS ********
show relaylog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp001.result b/mysql-test/suite/rpl/r/rpl_row_sp001.result
index 8c26c061376..17117ce2fac 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp001.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
<Begin test section 1 (non deterministic SP)>
---------------------------------------------
@@ -83,3 +79,4 @@ DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
index a42c9af988c..f368cf6e356 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
@@ -1,15 +1,5 @@
-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;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP PROCEDURE IF EXISTS test.p3;
-DROP TABLE IF EXISTS test.t3;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
+include/master-slave.inc
+[connection master]
CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=INNODB;
CREATE TABLE test.t2 (a INT AUTO_INCREMENT KEY, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON DELETE CASCADE) ENGINE=INNODB;
create procedure test.p1(IN i CHAR(6))
@@ -231,9 +221,10 @@ a t
98 NONE
SET AUTOCOMMIT=1;
SET FOREIGN_KEY_CHECKS=0;
-DROP PROCEDURE IF EXISTS test.p3;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t3;
+DROP PROCEDURE test.p3;
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp003.result b/mysql-test/suite/rpl/r/rpl_row_sp003.result
index df3e2a7ceed..42acf21c836 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp003.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
@@ -26,6 +22,11 @@ CALL test.p2();
SELECT release_lock("test");
release_lock("test")
1
+get_lock("test", 100)
+1
+SELECT release_lock("test");
+release_lock("test")
+1
SELECT * FROM test.t1;
a
5
@@ -37,7 +38,10 @@ CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
CALL test.p2();
CALL test.p1();
get_lock("test", 100)
-0
+1
+SELECT release_lock("test");
+release_lock("test")
+1
SELECT * FROM test.t1;
a
8
@@ -47,3 +51,4 @@ a
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp005.result b/mysql-test/suite/rpl/r/rpl_row_sp005.result
index 58c53b394b2..0496fd6fe46 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp005.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp005.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@@ -100,3 +96,4 @@ DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
index 079e750e2eb..2b3348270f1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP PROCEDURE IF EXISTS p1;
@@ -44,3 +40,4 @@ DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
index 5a6a9ace4c5..4f5008aae65 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
@@ -1,11 +1,5 @@
-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;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
+include/master-slave.inc
+[connection master]
CREATE PROCEDURE test.p1(IN i INT)
BEGIN
DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
@@ -44,5 +38,6 @@ num
SELECT * FROM test.t1;
num
13
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp008.result b/mysql-test/suite/rpl/r/rpl_row_sp008.result
index 23197964a24..f817e9c5f1b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp008.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp008.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t2;
CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
@@ -32,3 +28,4 @@ a
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp009.result b/mysql-test/suite/rpl/r/rpl_row_sp009.result
index 35ce0d7b420..8e9a2cbb8e9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp009.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp009.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -75,3 +71,4 @@ a
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp010.result b/mysql-test/suite/rpl/r/rpl_row_sp010.result
index 02567465428..d31f37d8411 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp010.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp010.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -54,3 +50,4 @@ DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p4;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp011.result b/mysql-test/suite/rpl/r/rpl_row_sp011.result
index e35c9f21adb..8588d739dff 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp011.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp011.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -67,3 +63,4 @@ DROP PROCEDURE IF EXISTS test.p6;
DROP PROCEDURE IF EXISTS test.p7;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result
index b9c818bad9a..57d92386638 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp012.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -57,3 +53,4 @@ DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP USER user1@localhost;
+include/rpl_end.inc
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 0e745feb3cd..49dccfc5d73 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
@@ -118,27 +114,23 @@ a b
SELECT * FROM t2;
a
2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (5);
INSERT INTO t5 VALUES (5,10,25);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
INSERT INTO t6 VALUES (6,12,36);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -194,3 +186,4 @@ a b x y z
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
SET @@global.sql_mode= @my_sql_mode;
+include/rpl_end.inc
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 7bd3be78c60..9c1e2740c03 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
@@ -118,27 +114,23 @@ a b
SELECT * FROM t2;
a
2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (5);
INSERT INTO t5 VALUES (5,10,25);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
INSERT INTO t6 VALUES (6,12,36);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -194,3 +186,4 @@ a b x y z
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
SET @@global.sql_mode= @my_sql_mode;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
deleted file mode 100644
index 5876a0e1b65..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
+++ /dev/null
@@ -1,288 +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;
-STOP SLAVE;
-SET @my_sql_mode= @@global.sql_mode;
-SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
-START SLAVE;
-CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t4 (a INT) ENGINE='NDB';
-CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='NDB';
-CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='NDB';
-CREATE TABLE t9 (a INT) ENGINE='NDB';
-ALTER TABLE t1_int ADD x INT DEFAULT 42;
-ALTER TABLE t1_bit
-ADD x BIT(3) DEFAULT b'011',
-ADD y BIT(5) DEFAULT b'10101',
-ADD z BIT(2) DEFAULT b'10';
-ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
-ALTER TABLE t1_nodef ADD x INT NOT NULL;
-ALTER TABLE t2 DROP b;
-ALTER TABLE t4 MODIFY a FLOAT;
-ALTER TABLE t5 MODIFY b FLOAT;
-ALTER TABLE t6 MODIFY c FLOAT;
-INSERT INTO t1_int VALUES (2, 4, 4711);
-INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
-INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
-**** On Master ****
-INSERT INTO t1_int VALUES (1,2);
-INSERT INTO t1_int VALUES (2,5);
-INSERT INTO t1_bit VALUES (1,2);
-INSERT INTO t1_bit VALUES (2,5);
-INSERT INTO t1_char VALUES (1,2);
-INSERT INTO t1_char VALUES (2,5);
-SELECT * FROM t1_int;
-a b
-1 2
-2 5
-SELECT * FROM t1_bit;
-a b
-1 2
-2 5
-SELECT * FROM t1_char;
-a b
-1 2
-2 5
-**** On Slave ****
-SELECT a,b,x FROM t1_int;
-a b x
-1 2 42
-2 5 42
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 5 3 15 2
-SELECT a,b,x FROM t1_char;
-a b x
-1 2 Just a test
-2 5 Just a test
-**** On Master ****
-UPDATE t1_int SET b=2*b WHERE a=2;
-UPDATE t1_char SET b=2*b WHERE a=2;
-UPDATE t1_bit SET b=2*b WHERE a=2;
-SELECT * FROM t1_int;
-a b
-1 2
-2 10
-SELECT * FROM t1_bit;
-a b
-1 2
-2 10
-SELECT * FROM t1_char;
-a b
-1 2
-2 10
-**** On Slave ****
-SELECT a,b,x FROM t1_int;
-a b x
-1 2 42
-2 10 42
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 10 3 15 2
-SELECT a,b,x FROM t1_char;
-a b x
-1 2 Just a test
-2 10 Just a test
-INSERT INTO t9 VALUES (2);
-INSERT INTO t1_nodef VALUES (1,2);
-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 #
-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 1364
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
-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 #
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (2);
-INSERT INTO t2 VALUES (2,4);
-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 #
-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 1514
-Last_Error Table width mismatch - received 2 columns, test.t2 has 1 columns
-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 #
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (4);
-INSERT INTO t4 VALUES (4);
-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 #
-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 1514
-Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
-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 #
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (5);
-INSERT INTO t5 VALUES (5,10,25);
-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 #
-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 1514
-Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
-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 #
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-INSERT INTO t9 VALUES (6);
-INSERT INTO t6 VALUES (6,12,36);
-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 #
-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 1514
-Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
-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 #
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
-DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
-SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result b/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
index 711d0d063aa..eaee105a2d9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS `t1`;
### TABLE with field_metadata_size == 290
CREATE TABLE `t1` (
@@ -159,15 +155,10 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1`(c2) VALUES ('1');
FLUSH LOGS;
### assertion: the slave replicated event successfully and tables match
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE `t1`;
=== Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
-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;
+include/rpl_reset.inc
### action: generating several tables with different metadata
### sizes (resorting to perl)
### testing table with 249 field metadata size.
@@ -182,25 +173,26 @@ start slave;
### testing table with 258 field metadata size.
FLUSH LOGS;
### assertion: the slave replicated event successfully and tables match for t10
-Comparing tables master:test.t10 and slave:test.t10
+include/diff_tables.inc [master:t10, slave:t10]
### assertion: the slave replicated event successfully and tables match for t9
-Comparing tables master:test.t9 and slave:test.t9
+include/diff_tables.inc [master:t9, slave:t9]
### assertion: the slave replicated event successfully and tables match for t8
-Comparing tables master:test.t8 and slave:test.t8
+include/diff_tables.inc [master:t8, slave:t8]
### assertion: the slave replicated event successfully and tables match for t7
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
### assertion: the slave replicated event successfully and tables match for t6
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t6, slave:t6]
### assertion: the slave replicated event successfully and tables match for t5
-Comparing tables master:test.t5 and slave:test.t5
+include/diff_tables.inc [master:t5, slave:t5]
### assertion: the slave replicated event successfully and tables match for t4
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
### assertion: the slave replicated event successfully and tables match for t3
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t3, slave:t3]
### assertion: the slave replicated event successfully and tables match for t2
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
### assertion: the slave replicated event successfully and tables match for t1
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
### assertion: check that binlog is not corrupt. Using mysqlbinlog to
### detect failure. Before the patch mysqlbinlog would find
### a corrupted event, thence would fail.
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig001.result b/mysql-test/suite/rpl/r/rpl_row_trig001.result
index ea0ef27fccd..d00da976d30 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig001.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n));
CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n));
@@ -29,3 +25,4 @@ DROP TRIGGER test.t3_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig002.result b/mysql-test/suite/rpl/r/rpl_row_trig002.result
index 794104db750..b0be0316bf2 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig002.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TRIGGER test.t2_ai;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -67,3 +63,4 @@ DROP TRIGGER test.t2_ai;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig003.result b/mysql-test/suite/rpl/r/rpl_row_trig003.result
index 131af933b41..68552ede1c0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig003.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@@ -69,15 +65,9 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C
UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
DELETE FROM test.t1 WHERE id = 1;
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
DELETE FROM test.t2 WHERE id = 1;
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@@ -87,3 +77,4 @@ DROP TRIGGER test.t2_ad;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result
index d0d0657f875..50317b55e2e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig004.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig004.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TRIGGER test.t1_bi_t2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -28,3 +24,4 @@ n f
DROP TRIGGER test.t1_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
index f9181be9bc0..d3b892326ac 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TEMPORARY TABLE t1(c1 INTEGER);
CREATE TABLE t2(c1 INTEGER);
CREATE TABLE t1(c1 INTEGER);
@@ -27,3 +23,4 @@ SELECT * FROM t2;
c1
DROP TABLE t1;
DROP TABLE t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
index 800670b78ae..b9ae1893629 100644
--- a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT, b INT);
INSERT INTO t1 SELECT 1;
@@ -20,3 +16,4 @@ b
1
3
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index 81aeb0d645b..5629f5c8cdd 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4);
DROP TABLE t1;
@@ -14,27 +10,37 @@ DROP TABLE t2;
include/stop_slave.inc
RESET SLAVE;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1
+include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
n
1
2
3
4
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
n
1
2
3
4
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
+include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t2;
n
1
2
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE;
+include/wait_for_slave_to_start.inc
include/stop_slave.inc
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
+include/wait_for_slave_param.inc [Until_Log_Pos]
+include/wait_for_slave_sql_to_stop.inc
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS, RELAY_LOG_POS=RELAY_LOG_POS;
@@ -49,3 +55,6 @@ START SLAVE;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
Warnings:
Note 1254 Slave is already running
+include/stop_slave.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_utf16.result b/mysql-test/suite/rpl/r/rpl_row_utf16.result
index f7e66dd92ee..cca69e1da82 100644
--- a/mysql-test/suite/rpl/r/rpl_row_utf16.result
+++ b/mysql-test/suite/rpl/r/rpl_row_utf16.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1(c1 CHAR(10) CHARACTER SET utf16 DEFAULT 'ola');
INSERT INTO t1 VALUES ('abc');
INSERT INTO t1 VALUES ();
@@ -19,5 +15,6 @@ c1 abc
hex(c1) 006100620063
c1 ola
hex(c1) 006F006C0061
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_utf32.result b/mysql-test/suite/rpl/r/rpl_row_utf32.result
index e07db9c9e48..0a212544113 100644
--- a/mysql-test/suite/rpl/r/rpl_row_utf32.result
+++ b/mysql-test/suite/rpl/r/rpl_row_utf32.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN=0;
CREATE TABLE t1 (c1 char(255) DEFAULT NULL, KEY c1 (c1)) DEFAULT CHARSET=utf32;
Warnings:
@@ -23,3 +19,4 @@ DROP TABLE t1;
SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
include/stop_slave.inc
include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
index 4dfe5826f32..471de20ea6d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_view01.result
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create database if not exists mysqltest1;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
@@ -102,3 +98,4 @@ DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
DROP TABLE IF EXISTS mysqltest1.t10;
DROP DATABASE mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_wide_table.result b/mysql-test/suite/rpl/r/rpl_row_wide_table.result
index da96e84d1d5..f469a13837c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_wide_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_wide_table.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t300;
create table t300 (
f1 int,
@@ -316,3 +312,4 @@ one
1
*** Cleanup ***
DROP TABLE t300;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_savepoint.result b/mysql-test/suite/rpl/r/rpl_savepoint.result
index e1462f435a3..75eb0f307bb 100644
--- a/mysql-test/suite/rpl/r/rpl_savepoint.result
+++ b/mysql-test/suite/rpl/r/rpl_savepoint.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#
# Bug#50124 Rpl failure on DROP table with concurrent txn/non-txn
# DML flow and SAVEPOINT
@@ -30,3 +26,4 @@ COMMIT;
FLUSH LOGS;
# Connection master
DROP TABLE nt;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 13a5c179520..bb037de4e6d 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -1,21 +1,9 @@
-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;
+include/master-slave.inc
+[connection master]
#
# Uninstall semi-sync plugins on master and slave
#
include/stop_slave.inc
-reset slave;
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-reset master;
-set sql_log_bin=0;
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-set sql_log_bin=1;
#
# Main test of semi-sync replication start here
#
@@ -453,7 +441,9 @@ Rpl_semi_sync_slave_status OFF
include/stop_slave.inc
UNINSTALL PLUGIN rpl_semi_sync_slave;
UNINSTALL PLUGIN rpl_semi_sync_master;
+change master to master_user='root',master_password='';
include/start_slave.inc
drop table t1;
drop user rpl@127.0.0.1;
flush privileges;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
index f3f5aa1559d..1c6d73fe681 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
include/start_slave.inc
SET GLOBAL event_scheduler = ON;
@@ -44,3 +40,4 @@ include/start_slave.inc
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id.result b/mysql-test/suite/rpl/r/rpl_server_id.result
deleted file mode 100644
index f7d778a288b..00000000000
--- a/mysql-test/suite/rpl/r/rpl_server_id.result
+++ /dev/null
@@ -1,34 +0,0 @@
-set global server_id=1;
-reset master;
-drop table if exists t1,t2,t3;
-create table t1 (a int);
-select @@server_id;
-@@server_id
-1
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
-set global server_id=2;
-create table t2 (b int);
-select @@server_id;
-@@server_id
-2
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
-master-bin.000001 # Query 2 # use `test`; create table t2 (b int)
-set global server_id=3;
-create table t3 (c int);
-select @@server_id;
-@@server_id
-3
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
-master-bin.000001 # Query 2 # use `test`; create table t2 (b int)
-master-bin.000001 # Query 3 # use `test`; create table t3 (c int)
-set global server_id=1;
-drop table t1,t2,t3;
diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
index 76f187e3b01..80e5bbae146 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id1.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.result
@@ -1,13 +1,7 @@
-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;
-reset master;
-include/stop_slave.inc
-change master to master_port=SLAVE_PORT;
-start slave;
-*** must be having the replicate-same-server-id IO thread error ***
-Slave_IO_Errno= 1593
-Slave_IO_Error= Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
+include/rpl_init.inc [topology=2->2]
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1593]
+Last_IO_Error = 'Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).'
+include/stop_slave_sql.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index bb5a175fbfe..69c0e1f7d9b 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -1,30 +1,32 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (n int);
reset master;
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_port=SLAVE_PORT;
start slave;
+include/wait_for_slave_to_start.inc
insert into t1 values (1);
select * from t1;
n
1
1
stop slave;
+include/wait_for_slave_to_stop.inc
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 ***
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
+*** checking until position execution: must be only t1 in the list ***
show tables;
Tables_in_test
t1
start slave sql_thread;
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
index cba6571eb1a..0a4f414ad6e 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
master_id: 1
stop slave;
*** --replicate-same-server-id and change master option can clash ***
@@ -25,11 +21,13 @@ ignore server id list: 1, 3, 4, 5
*** ignore master (server 1) queries for a while ***
start slave;
create table t1 (n int);
+include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
*** must be empty as the event is to be filtered out ***
show tables;
Tables_in_test
*** allowing events from master ***
stop slave;
+include/wait_for_slave_to_stop.inc
reset slave;
change master to IGNORE_SERVER_IDS= (10, 100);
*** the list must remain (10, 100) after reset slave ***
@@ -44,3 +42,4 @@ Tables_in_test
t1
drop table t1;
end of the tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_session_var.result b/mysql-test/suite/rpl/r/rpl_session_var.result
index 297a18a5931..030ae161b22 100644
--- a/mysql-test/suite/rpl/r/rpl_session_var.result
+++ b/mysql-test/suite/rpl/r/rpl_session_var.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
@@ -51,3 +47,4 @@ SELECT length(data) < 100 FROM t1;
length(data) < 100
1
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_charset.result b/mysql-test/suite/rpl/r/rpl_set_charset.result
index 480d926fbba..fa30a361d13 100644
--- a/mysql-test/suite/rpl/r/rpl_set_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_set_charset.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1 /*!40100 character set latin2 */;
use mysqltest1;
@@ -46,3 +42,4 @@ D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0
drop database mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_null_innodb.result b/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
index 41600a5fe1b..f099b2b7691 100644
--- a/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
@@ -1,35 +1,22 @@
-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;
-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;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=InnoDB;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 CHAR) Engine=InnoDB;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 LIMIT 2;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_null_myisam.result b/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
index cbd7010664a..5698be4ff0c 100644
--- a/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
@@ -1,35 +1,22 @@
-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;
-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;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=MyISAM;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
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;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 CHAR) Engine=MyISAM;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 LIMIT 2;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sf.result b/mysql-test/suite/rpl/r/rpl_sf.result
deleted file mode 100644
index 085ba1ebb8a..00000000000
--- a/mysql-test/suite/rpl/r/rpl_sf.result
+++ /dev/null
@@ -1,68 +0,0 @@
-set global log_bin_trust_function_creators=0;
-set binlog_format=STATEMENT;
-create function fn16456()
-returns int
-begin
-return unix_timestamp();
-end|
-ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
-set global log_bin_trust_function_creators=1;
-create function fn16456()
-returns int
-begin
-return unix_timestamp();
-end|
-set global log_bin_trust_function_creators=0;
-set binlog_format=ROW;
-select fn16456();
-fn16456()
-timestamp
-set binlog_format=STATEMENT;
-select fn16456();
-ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
-drop function fn16456;
-set global log_bin_trust_function_creators=0;
-create function fn16456()
-returns int deterministic
-begin
-return unix_timestamp();
-end|
-set binlog_format=ROW;
-select fn16456();
-fn16456()
-timestamp
-set binlog_format=STATEMENT;
-select fn16456();
-fn16456()
-timestamp
-drop function fn16456;
-set global log_bin_trust_function_creators=0;
-create function fn16456()
-returns int no sql
-begin
-return unix_timestamp();
-end|
-set binlog_format=ROW;
-select fn16456();
-fn16456()
-timestamp
-set binlog_format=STATEMENT;
-select fn16456();
-fn16456()
-timestamp
-drop function fn16456;
-set global log_bin_trust_function_creators=0;
-create function fn16456()
-returns int reads sql data
-begin
-return unix_timestamp();
-end|
-set binlog_format=ROW;
-select fn16456();
-fn16456()
-timestamp
-set binlog_format=STATEMENT;
-select fn16456();
-fn16456()
-timestamp
-drop function fn16456;
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
index 9838d8b08a8..2ada5670e04 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
@@ -1,17 +1,15 @@
-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;
+include/master-slave.inc
+[connection master]
RESET SLAVE;
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root';
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
SHOW SLAVE HOSTS;
Server_id Host Port Master_id
3 slave2 DEFAULT_PORT 1
2 SLAVE_PORT 1
-STOP SLAVE IO_THREAD;
+include/stop_slave_io.inc
SHOW SLAVE HOSTS;
Server_id Host Port Master_id
2 SLAVE_PORT 1
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_running.result b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
index 556acb14e5c..599290ac776 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_running.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET DEBUG_SYNC= 'RESET';
include/stop_slave.inc
set global debug= 'd,dbug.before_get_running_status_yes';
@@ -21,6 +17,7 @@ Slave_running OFF
Slave_IO_Running= Connecting
Slave_SQL_Running= No
SET DEBUG_SYNC='now SIGNAL signal.io_thread_let_running';
+include/wait_for_slave_param.inc [Slave_IO_Running]
Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
@@ -28,6 +25,7 @@ Slave_running OFF
Slave_IO_Running= Yes
Slave_SQL_Running= No
start slave sql_thread;
+include/wait_for_slave_sql_to_start.inc
Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
@@ -37,3 +35,4 @@ Slave_SQL_Running= Yes
set global debug= '';
SET DEBUG_SYNC= 'RESET';
End of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index 0aa8069a38c..f5675b5e25f 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Test Without sql_mode=strict_trans_tables ====
[on master]
create table t1 (n int not null primary key);
@@ -31,7 +27,7 @@ n
3
7
8
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
==== Clean Up ====
drop table t1;
create table t1(a int primary key);
@@ -46,7 +42,7 @@ select * from t1;
a
1
2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
==== Clean Up ====
drop table t1;
==== Using Innodb ====
@@ -60,6 +56,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET SQL_LOG_BIN=1;
+call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062");
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
@@ -112,3 +109,4 @@ UPDATE t2 SET id= id + 3, data = 2;
==== Clean Up ====
DROP TABLE t1;
DROP TABLE t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
index eb3c4ef5978..4c3b08589d9 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
*** Preparing data ***
CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
@@ -33,6 +29,8 @@ a b
SELECT * FROM t3 ORDER BY a;
a b
1 ZZ
+call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146");
+include/wait_for_slave_sql_error.inc [errno=1146]
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
@@ -44,7 +42,7 @@ a b
SELECT * FROM t2 ORDER BY a;
a b
1 AA_for_row_or_YY_for_stmt_mixed
-include/stop_slave.inc
+include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
TRUNCATE t1;
@@ -60,6 +58,7 @@ 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;
+include/wait_for_slave_sql_error.inc [errno=1146]
SELECT * FROM t1 ORDER BY a;
a b
2 X
@@ -78,7 +77,7 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
-include/stop_slave.inc
+include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
TRUNCATE t1;
@@ -95,6 +94,7 @@ 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;
+include/wait_for_slave_sql_error.inc [errno=1146]
SELECT * FROM t1 ORDER BY a;
a b
3 C
@@ -116,8 +116,9 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
-include/stop_slave.inc
+include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
*** Clean up ***
DROP TABLE t1,t2,t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_in.result b/mysql-test/suite/rpl/r/rpl_slave_load_in.result
index 2cc83fd0a19..504f6f60d9e 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_in.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_in.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1(a int not null auto_increment, b int, primary key(a));
create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
@@ -13,7 +9,8 @@ insert into t2(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
commit;
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
index 85fbcb69760..e08c066d226 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
@@ -1,16 +1,21 @@
-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;
+include/master-slave.inc
+[connection master]
+SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write';
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
start transaction;
insert into t1(b) values (1);
insert into t1(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
commit;
+include/wait_for_slave_sql_error.inc [errno=29, 13]
drop table t1;
+include/sync_slave_io_with_master.inc
+include/stop_slave_io.inc
+RESET SLAVE;
drop table t1;
call mtr.add_suppression("Slave: Can't get stat of .*");
+call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13");
call mtr.add_suppression("Slave: File.* not found.*");
+call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29");
+SET @@GLOBAL.DEBUG = '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
index 3ed14a9cb6b..262404ff6f9 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
@@ -1,6 +1,8 @@
-CHANGE MASTER TO MASTER_USER='root',
-MASTER_CONNECT_RETRY=1,
-MASTER_HOST='127.0.0.1',
-MASTER_PORT=MASTER_MYPORT;
+include/master-slave.inc
+[connection master]
START SLAVE;
-12
+call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12");
+include/wait_for_slave_sql_error.inc [errno=12]
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index 5feba69b64d..a1884731a3e 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -1,11 +1,8 @@
-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;
+include/master-slave.inc
+[connection master]
**** On Slave ****
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
@@ -43,8 +40,12 @@ c d
3 18
**** On Slave ****
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+include/wait_for_slave_sql_to_stop.inc
+include/check_slave_param.inc [Exec_Master_Log_Pos]
+include/check_slave_no_error.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
+include/wait_for_slave_to_start.inc
SELECT * FROM t1;
a b
1 1
@@ -56,6 +57,7 @@ c d
2 8
3 27
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
RESET SLAVE;
RESET MASTER;
SET SESSION BINLOG_FORMAT=STATEMENT;
@@ -68,8 +70,10 @@ master-bin.000001 # User var # # @`foo`=12
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo)
master-bin.000001 # Query # # COMMIT
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
+include/wait_for_slave_to_start.inc
**** On Master ****
DROP TABLE t1, t2;
SET SESSION BINLOG_FORMAT=ROW;
@@ -281,3 +285,4 @@ include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
DROP TABLE t10;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index a98a81dc74f..be978362c81 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Create new replication user ====
[on master]
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
@@ -27,9 +23,14 @@ FLUSH PRIVILEGES;
==== Restart slave without privileges =====
include/stop_slave.inc
START SLAVE;
-==== Verify that Slave_IO_Running = No ====
-Slave_IO_Running = No (should be No)
+include/wait_for_slave_sql_to_start.inc
+include/wait_for_slave_io_to_stop.inc
+==== Verify that Slave IO thread stopped with error ====
+include/wait_for_slave_io_error.inc [errno=1045]
==== Cleanup (Note that slave IO thread is not running) ====
-DROP TABLE t1;
+include/stop_slave_sql.inc
+CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
+include/rpl_reset.inc
[on master]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
index 0b35cf68e96..79b83b4ceb9 100644
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -1,10 +1,7 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
include/stop_slave.inc
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
@@ -46,12 +43,7 @@ include/stop_slave.inc
SET GLOBAL long_query_time= @old_long_query_time;
SET GLOBAL log_output= @old_log_output;
include/start_slave.inc
-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;
+include/rpl_reset.inc
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
SET GLOBAL long_query_time= 2;
@@ -89,3 +81,4 @@ SET @@global.long_query_time= @old_long_query_time;
DROP TABLE t1;
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 7d1d050e56b..4b9e768861d 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -1238,14 +1234,7 @@ ERROR 42000: FUNCTION test.f1 does not exist
#
# Bug #11918 Can't use a declared variable in LIMIT clause
#
-drop table if exists t1;
-drop procedure if exists p1;
-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;
+include/rpl_reset.inc
create table t1 (c1 int);
insert into t1 (c1) values
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -1281,3 +1270,4 @@ set @@session.binlog_format=@save_binlog_format;
drop table t1;
drop procedure p1;
# End of 5.5 tests.
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp004.result b/mysql-test/suite/rpl/r/rpl_sp004.result
index 1c0ed3cc50a..5b67d225490 100644
--- a/mysql-test/suite/rpl/r/rpl_sp004.result
+++ b/mysql-test/suite/rpl/r/rpl_sp004.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@@ -91,3 +87,4 @@ DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index d9cdfd81167..a6e3ae03963 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
@@ -278,3 +274,4 @@ drop procedure sp_bug26199;
drop function sf_bug26199;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_spec_variables.result b/mysql-test/suite/rpl/r/rpl_spec_variables.result
index ea2778bf71c..785913134a7 100644
--- a/mysql-test/suite/rpl/r/rpl_spec_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_spec_variables.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
* auto_increment_increment, auto_increment_offset *
SET @@global.auto_increment_increment=2;
@@ -173,7 +169,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(10) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -223,3 +219,4 @@ SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size;
SET @@global.storage_engine=@restore_slave_storage_engine;
call mtr.add_suppression("The table 't[12]' is full");
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sporadic_master.result b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
index 14fb673a081..1ec94964acf 100644
--- a/mysql-test/suite/rpl/r/rpl_sporadic_master.result
+++ b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
@@ -1,16 +1,12 @@
-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;
+include/master-slave.inc
+[connection master]
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
insert into t1 values (4),(NULL);
-stop slave;
-start slave;
+include/stop_slave.inc
+include/start_slave.inc
insert into t1 values (NULL),(NULL);
flush logs;
truncate table t1;
@@ -24,3 +20,4 @@ n
14
15
drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index 1af4c5e227c..35aaabc8c56 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int auto_increment, KEY(t));
stop slave;
@@ -19,23 +15,32 @@ insert into t1 values(1);
select * from t1;
t
1
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
STOP SLAVE;
select * from t1;
t
1
insert into t1 values (NULL);
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Checking that both slave threads are running.
+include/wait_for_slave_to_start.inc
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
drop user replssl@localhost;
drop table t1;
+include/stop_slave.inc
+CHANGE MASTER TO
+master_user = 'root',
+master_ssl = 0,
+master_ssl_ca = '',
+master_ssl_cert = '',
+master_ssl_key = '';
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index 5b4aa126c77..a7a56d7c5ee 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -1,41 +1,43 @@
-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;
+include/master-slave.inc
+[connection master]
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_user='replssl',master_password='';
start slave;
insert into t1 values (1);
select * from t1;
t
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
+include/wait_for_slave_to_start.inc
select * from t1;
t
1
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_user='root',master_password='', master_ssl=0;
start slave;
+include/wait_for_slave_to_start.inc
drop user replssl@localhost;
drop table t1;
-Master_SSL_Allowed No
-Master_SSL_CA_Path
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'No'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
stop slave;
+include/wait_for_slave_to_stop.inc
change master to
master_host="localhost",
master_ssl=1 ,
@@ -44,16 +46,26 @@ master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem',
master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem',
master_ssl_verify_server_cert=1;
start slave;
+include/wait_for_slave_to_start.inc
create table t1 (t int);
insert into t1 values (1);
on slave
select * from t1;
t
1
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
-Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
-Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
drop table t1;
+include/stop_slave.inc
+CHANGE MASTER TO
+master_host="127.0.0.1",
+master_ssl_ca ='',
+master_ssl_cert='',
+master_ssl_key='',
+master_ssl_verify_server_cert=0,
+master_ssl=0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 7fd9a6a9c92..65715b471aa 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
@@ -40,6 +36,7 @@ stop slave;
reset slave;
lock tables t1 read;
start slave;
+include/sync_slave_io_with_master.inc
unlock tables;
create table t2(id int);
insert into t2 values(connection_id());
@@ -52,8 +49,7 @@ select (@id := id) - id from t2;
kill @id;
drop table t2;
Got one of the listed errors
-set global sql_slave_skip_counter=1;
-start slave;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1053]
select count(*) from t1;
count(*)
5000
@@ -82,3 +78,4 @@ select_priv user
Y blafasel2
drop table t1;
delete from mysql.user where user="blafasel2";
+include/rpl_end.inc
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 e69952787fb..d4a14adc6b8 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int, unique(a)) engine=myisam;
set sql_log_bin=0;
insert into t1 values(2);
@@ -11,6 +7,11 @@ 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)
+include/wait_for_slave_sql_to_stop.inc
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0");
+Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=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;
+include/stop_slave.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
index 7cbe1d73254..cade32bbfdd 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY);
@@ -206,3 +202,4 @@ DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
index 1ad34fbe961..14ed79680f1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
@@ -1,10 +1,10 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,13 +15,11 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
Got one of the listed errors
*** Single statement on non-transactional table ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
*** Single statement on both transactional and non-transactional tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
@@ -38,7 +36,7 @@ Got one of the listed errors
BEGIN;
Got one of the listed errors
Got one of the listed errors
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
@@ -50,7 +48,7 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
@@ -64,7 +62,7 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
@@ -88,7 +86,7 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
@@ -103,7 +101,7 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
@@ -118,7 +116,45 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1197]
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -126,8 +162,6 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-Warnings:
-Note 1051 Unknown table 't6'
+DROP TABLE t5;
DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
index 6d9759b3562..e30429540fb 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
CREATE TABLE t1(a INT PRIMARY KEY);
@@ -19,14 +15,17 @@ a
1
[on slave]
---- Wait until slave stops with an error ----
+include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error (expected "duplicate key" error)
Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)'
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
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;
+include/wait_for_slave_sql_to_start.inc
---- Sync slave and verify that there is no error ----
Last_SQL_Error = '' (expected no error)
SELECT * FROM t1;
@@ -53,3 +52,4 @@ a
[on master]
DROP TABLE t1;
[on slave]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
index 75f668d8c08..3f72e281b0b 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -1613,3 +1609,4 @@ DROP TABLE IF EXISTS nt_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
SET @commands= '';
+include/rpl_end.inc
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 fe2fb1d9da2..6b8d8b9407e 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
@@ -1,10 +1,6 @@
-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) ENGINE=MyISAM;
+include/master-slave.inc
+[connection master]
+create table t1 (a int);
insert into t1 values (10);
create table t2 (a int) ENGINE=MyISAM;
create table t3 (a int) engine=merge union(t1);
@@ -21,10 +17,13 @@ flush tables;
select * from t3;
a
stop slave;
+include/wait_for_slave_to_stop.inc
drop table t1;
flush tables with read lock;
start slave;
+include/wait_for_slave_to_start.inc
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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
index 2388c4e4b7c..eff96952918 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialize ====
**** On Master ****
CREATE TABLE t1 (a INT);
@@ -100,8 +96,4 @@ DROP TABLE t1, logtbl;
DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
index e48f1a7d0f3..626b748e63d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
@@ -524,10 +520,8 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db
###################################################################################
# CHECK CONSISTENCY
###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
+include/diff_tables.inc [master:tt_1,slave:tt_1]
###################################################################################
# CLEAN
###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result
index f99457faaf0..0e9531317b9 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_innodb.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t4 (
id INT(5) unsigned NOT NULL auto_increment,
name varchar(15) NOT NULL default '',
@@ -130,3 +126,4 @@ id b
DROP TABLE t1;
DROP TABLE t3;
End of 6.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
index c6b743c7c89..afff633cd49 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@ -51,8 +47,8 @@ CREATE TABLE t1(a int, UNIQUE(a));
INSERT DELAYED IGNORE INTO t1 VALUES(1);
INSERT DELAYED IGNORE INTO t1 VALUES(1);
flush table t1;
-use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
-use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+use `test`; INSERT IGNORE INTO t1 VALUES(1)
+use `test`; INSERT IGNORE INTO t1 VALUES(1)
select * from t1;
a
1
@@ -60,10 +56,10 @@ On slave
show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,6;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Query # # BEGIN
-slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1)
slave-bin.000002 # Query # # COMMIT
slave-bin.000002 # Query # # BEGIN
-slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1)
slave-bin.000002 # Query # # COMMIT
select * from t1;
a
@@ -72,3 +68,4 @@ drop table t1;
FLUSH LOGS;
FLUSH LOGS;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
index 417da0e2237..feedc3d8281 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
@@ -14,13 +14,8 @@ master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`c1`) ;file_id=#
master-bin.000001 # Query # # COMMIT
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;
-reset master;
+include/master-slave.inc
+[connection master]
select last_insert_id();
last_insert_id()
0
@@ -48,32 +43,29 @@ drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-set global sql_slave_skip_counter=1;
-start slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+include/check_slave_no_error.inc
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-stop slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -96,18 +88,14 @@ load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fie
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'
+include/wait_for_slave_sql_error.inc [errno=0]
drop table t1, t2;
drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
-DROP TABLE IF EXISTS 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;
+DROP TABLE t1;
+include/rpl_reset.inc
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -128,15 +116,10 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection
use b48297_db1;
-Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
+include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
-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;
+include/rpl_reset.inc
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -148,3 +131,4 @@ Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
index 1abb0d88bbe..72fae5ce6ee 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@@ -229,3 +225,4 @@ aberration
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 472be5ee607..3bb3f347a43 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -1,13 +1,11 @@
-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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
@@ -241,18 +239,13 @@ slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Query # # use `test`; insert into t2 values (1)
slave-bin.000002 # Query # # COMMIT
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
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;
+include/rpl_reset.inc
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -275,3 +268,4 @@ a b
5 1
6 1
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index 547dd8e1541..379cea4d3fc 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
@@ -23,7 +19,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 2
#
@@ -33,7 +29,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 3: max_relay_log_size = 0
#
@@ -43,7 +39,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size 0
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
@@ -57,13 +53,13 @@ reset slave;
start slave;
flush logs;
create table t1 (a int);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
drop table t1;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
@@ -72,3 +68,4 @@ set global max_binlog_size= @my_max_binlog_size;
#
# End of 4.1 tests
#
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
index 5dc86137635..f706fa0fe75 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
@@ -1,18 +1,12 @@
-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;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'master-bin.000001' 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)
master-bin.000001 # Query # # BEGIN
@@ -24,16 +18,17 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
master-bin.000001 # Query # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS ********
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)
@@ -46,30 +41,8 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-master-bin.000001 # Query # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-bin.000001 # Query # # BEGIN
@@ -81,16 +54,17 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-bin.000001 # Query # # COMMIT
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -103,29 +77,7 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
@@ -140,39 +92,35 @@ slave-relay-bin.000003 # Query # # COMMIT
slave-relay-bin.000003 # Query # # BEGIN
slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-slave-relay-bin.000003 # Query # # COMMIT
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
-show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 3;
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1,3;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-relay-bin.000003 # Query # # BEGIN
+******** [slave] SHOW RELAYLOG EVENTS ********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
FLUSH LOGS;
FLUSH LOGS;
DROP TABLE t1;
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'master-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [master] SHOW BINLOG EVENTS ********
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)
@@ -185,21 +133,19 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=4
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'slave-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -212,23 +158,25 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
-slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS ********
show relaylog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
index c11f974ac2f..6e0ee695b41 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11266,23 +11262,6 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
-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` (
-`c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
-`c2` tinyint(1) unsigned DEFAULT NULL,
-`c3` varchar(300) DEFAULT NULL,
-`c4` int(10) unsigned NOT NULL,
-`c5` int(10) unsigned DEFAULT NULL,
-PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-ALTER TABLE `t1` Engine=InnoDB;
-SET AUTOCOMMIT=0;
-INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL);
-COMMIT;
-ROLLBACK;
-SET AUTOCOMMIT=1;
-Comparing tables master:test.t1 and slave:test.t1
-DROP TABLE `t1`;
+include/rpl_reset.inc
+include/diff_tables.inc [master:t1, slave:t1]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
index 0bd57d4b78a..68c769a7ede 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
@@ -1,10 +1,5 @@
-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;
-drop database if exists mysqltest;
+include/master-slave.inc
+[connection master]
create database mysqltest;
create table mysqltest.t1 ( n int);
insert into mysqltest.t1 values(1)/
@@ -21,7 +16,6 @@ n
5
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 mysqltest
master-bin.000001 # Query # # create database mysqltest
master-bin.000001 # Query # # use `test`; create table mysqltest.t1 ( n int)
master-bin.000001 # Query # # BEGIN
@@ -40,3 +34,4 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(5)
master-bin.000001 # Query # # COMMIT
drop database mysqltest;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_no_op.result b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
index 5a253d61fcb..cf5b03cdfa6 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_no_op.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create database mysqltest;
drop database if exists mysqltest;
Warnings:
@@ -50,3 +46,4 @@ a b
select * from t2;
a b
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index c6c2c525098..aa8bc63a432 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -1,22 +1,18 @@
-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;
-Master_User root
-Master_Host 127.0.0.1
+include/master-slave.inc
+[connection master]
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
change master to master_user='test';
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
reset slave;
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
change master to master_user='root';
include/start_slave.inc
-Master_User root
-Master_Host 127.0.0.1
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
@@ -29,13 +25,20 @@ Variable_name Value
Slave_open_temp_tables 1
include/stop_slave.inc
reset slave;
+include/check_slave_no_error.inc
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
change master to master_user='root';
include/start_slave.inc
+include/check_slave_no_error.inc
stop slave;
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
reset slave;
+include/check_slave_no_error.inc
+change master to master_user='root';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result b/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
index fd143fc8a50..fa5ac2a0c85 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (pk integer auto_increment , primary key (pk));
SET SESSION SQL_MODE='traditional';
# **** [MASTER] *****
@@ -16,3 +12,4 @@ DROP TABLE t1;
# assertion: sync slave with master makes slave not to stop with
# duplicate key error (because it has received event
# with expected error code).
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
index 71ad0177bae..57206873e2f 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
@@ -1,17 +1,19 @@
-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;
+include/master-slave.inc
+[connection master]
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
SET @@session.binlog_direct_non_transactional_updates= FALSE;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(n int);
stop slave;
+include/wait_for_slave_to_stop.inc
start slave;
stop slave io_thread;
start slave io_thread;
+include/wait_for_slave_to_start.inc
drop table t1;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
@@ -33,6 +35,7 @@ zero
0
stop slave;
rollback;
+include/wait_for_slave_to_stop.inc
*** sql thread is *not* running: No ***
*** the prove: the stopped slave has finished the current transaction ***
five
@@ -43,3 +46,30 @@ one
1
include/start_slave.inc
drop table t1i, t2m;
+#
+# Bug#56096 STOP SLAVE hangs if executed in parallel with user sleep
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT );
+# Slave1: lock table for synchronization
+LOCK TABLES t1 WRITE;
+# Master: insert into the table
+INSERT INTO t1 SELECT SLEEP(4);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+# Slave: wait for the insert
+# Slave: send slave stop
+STOP SLAVE;
+# Slave1: wait for stop slave
+# Slave1: unlock the table
+UNLOCK TABLES;
+# Slave: wait for the slave to stop
+include/wait_for_slave_to_stop.inc
+# Start slave again
+include/start_slave.inc
+# Clean up
+DROP TABLE t1;
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
index eb1d6689bfc..0b3233437aa 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET @@session.binlog_direct_non_transactional_updates= FALSE;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table tm (a int auto_increment primary key) engine=myisam;
@@ -15,6 +11,9 @@ insert into tm set a=null;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
commit;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes");
+include/wait_for_slave_sql_to_stop.inc
SELECT "NO" AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
NO 1
@@ -36,9 +35,10 @@ insert into tm set a=null;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
commit;
-SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+include/wait_for_slave_sql_to_stop.inc
+SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
-Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
+Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
select count(*) as one from tm;
one
1
@@ -52,9 +52,10 @@ include/start_slave.inc
set @@global.debug="+d,stop_slave_middle_group";
set @@global.debug="+d,incomplete_group_in_relay_log";
update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
-SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+include/wait_for_slave_sql_to_stop.inc
+SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
-Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
+Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
select max(a) as two from tm;
two
2
@@ -62,6 +63,6 @@ select max(a) as one from ti;
one
1
set @@global.debug="-d";
+include/rpl_reset.inc
drop table tm, ti;
-include/stop_slave.inc
-drop table tm, ti;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index c9c97bc533c..ed1d9a6f226 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
[on slave]
include/stop_slave.inc
==== Create some events on master ====
@@ -18,29 +14,41 @@ drop table t2;
==== Replicate one event at a time on slave ====
[on slave]
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
select * from t1;
n
1
2
3
4
+include/check_slave_param.inc [Exec_Master_Log_Pos]
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
select * from t1;
n
1
2
3
4
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS;
+include/check_slave_param.inc [Exec_Master_Log_Pos]
+start slave until relay_log_file='slave-relay-bin.000003', relay_log_pos=RELAY_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
select * from t2;
n
1
2
+include/check_slave_param.inc [Exec_Master_Log_Pos]
start slave;
[on master]
[on slave]
include/stop_slave.inc
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
+include/check_slave_param.inc [Exec_Master_Log_Pos]
==== Test various error conditions ====
start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
@@ -75,6 +83,7 @@ select count(*) as two from t1;
two
2
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos= UNTIL_POS;;
+include/wait_for_slave_sql_to_stop.inc
slave stopped at the prescribed position
select 0 as zero;
zero
@@ -84,24 +93,17 @@ one
1
drop table t1;
start slave;
-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;
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 't1'
+include/rpl_reset.inc
+flush logs;
stop slave;
flush logs;
flush logs;
reset slave;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; /* to stop right before DROP */;
+include/wait_for_slave_sql_to_stop.inc
show tables /* t1 must exist */;
Tables_in_test
t1
drop table t1;
stop slave;
-reset slave;
-reset master;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
index 8f43425b201..e59928af66d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
SET @positive= 18446744073709551615;
SET @negative= -9223372036854775808;
CREATE TABLE t1 (`tinyint` TINYINT,
@@ -58,7 +54,7 @@ real 18446744073709552000.00
decimal 18446744073709551615.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
### b) user var
INSERT INTO t1 VALUES (@positive,
@@ -110,7 +106,7 @@ real 18446744073709552000.00
decimal 18446744073709551615.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
### insert min signed
### a) declarative
@@ -150,7 +146,7 @@ real -9223372036854776000.00
decimal -9223372036854775808.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
### b) user var
INSERT INTO t1 VALUES (@negative,
@@ -202,16 +198,11 @@ real -9223372036854776000.00
decimal -9223372036854775808.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
## check: contents of both tables master's and slave's
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;
+include/rpl_reset.inc
CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW SET @aux = -1 ;
SET @aux = 10294947273192243200;
@@ -219,6 +210,7 @@ SET @aux1= @aux;
INSERT INTO t1 VALUES (@aux) , (@aux1);
ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
DROP TRIGGER tr1;
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
new file mode 100644
index 00000000000..588d9bbabf5
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -0,0 +1,122 @@
+include/master-slave.inc
+[connection master]
+
+# BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+#
+# If a temporary table is created or dropped, the transaction should be
+# regarded similarly that a non-transactional table is modified. So
+# STOP SLAVE should wait until the transaction has finished.
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+SET DEBUG_SYNC= 'RESET';
+include/stop_slave.inc
+
+# Suspend the INSERT statement in current transaction on SQL thread.
+# It guarantees that SQL thread is applying the transaction when
+# STOP SLAVE command launchs.
+SET GLOBAL debug= 'd,after_mysql_insert';
+include/start_slave.inc
+
+# CREATE TEMPORARY TABLE with InnoDB engine
+# -----------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+include/wait_for_slave_sql_to_stop.inc
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+include/diff_tables.inc [master:t1, slave:t1]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
+
+# CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+# ----------------------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+SELECT c1 FROM t2;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+include/wait_for_slave_sql_to_stop.inc
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+include/diff_tables.inc [master:t1, slave:t1]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
+
+# Test end
+SET GLOBAL debug= '$debug_save';
+include/restart_slave.inc
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+[connection master]
+DROP TABLE t1, t2;
+
+# Bug#58546 test rpl_packet timeout failure sporadically on PB
+# ----------------------------------------------------------------------
+# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
+# possible that IO thread stopped after replicating part of a transaction
+# which SQL thread was executing. SQL thread would be hung if the
+# transaction could not be rolled back safely.
+# It caused some sporadic failures on PB2.
+#
+# This test verifies that when 'STOP SLAVE' is issued by a user, IO
+# thread will continue to fetch the rest events of the transaction which
+# is being executed by SQL thread and is not able to be rolled back safely.
+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1, 1);
+[connection master]
+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
+[connection slave]
+include/restart_slave.inc
+BEGIN;
+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
+[connection master]
+BEGIN;
+INSERT INTO t1 VALUES(2, 2);
+INSERT INTO t2 VALUES(1);
+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
+COMMIT;
+[connection slave1]
+STOP SLAVE;
+[connection slave]
+ROLLBACK;
+[connection master]
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+[connection slave]
+include/wait_for_slave_to_stop.inc
+[connection slave1]
+include/start_slave.inc
+[connection master]
+DROP TABLE t1, t2;
+SET GLOBAL debug= $debug_save;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
index 23400df98bc..33666defaa4 100644
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -427,3 +423,4 @@ INSERT INTO t13 VALUES (CURRENT_USER());
INSERT INTO t13 VALUES (my_current_user());
drop database mysqltest1;
set global binlog_format =@my_binlog_format;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-test/suite/rpl/r/rpl_sync.result
index edc20c46140..de3506465aa 100644
--- a/mysql-test/suite/rpl/r/rpl_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_sync.result
@@ -1,10 +1,6 @@
=====Configuring the enviroment=======;
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
@@ -12,20 +8,21 @@ insert into t1(a) values(1);
insert into t1(a) values(2);
insert into t1(a) values(3);
=====Inserting data on the master but without the SQL Thread being running=======;
-stop slave SQL_THREAD;
+include/stop_slave_sql.inc
insert into t1(a) values(4);
insert into t1(a) values(5);
insert into t1(a) values(6);
=====Removing relay log files and crashing/recoverying the slave=======;
-stop slave IO_THREAD;
+include/stop_slave_io.inc
SET SESSION debug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
+include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
-start slave;
-Comparing tables master:test.t1 and slave:test.t1
+include/start_slave.inc
+include/diff_tables.inc [master:t1,slave:t1]
=====Corrupting the master.info=======;
-stop slave;
+include/stop_slave.inc
FLUSH LOGS;
insert into t1(a) values(7);
insert into t1(a) values(8);
@@ -33,8 +30,10 @@ insert into t1(a) values(9);
SET SESSION debug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
+include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
-start slave;
-Comparing tables master:test.t1 and slave:test.t1
+include/start_slave.inc
+include/diff_tables.inc [master:t1,slave:t1]
=====Clean up=======;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result
index e4ca31d8908..e7df070874a 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int);
create temporary table t3 (n int not null);
@@ -46,3 +42,4 @@ Slave_open_temp_tables 0
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
index e90d7c3f2d2..8fb910666dc 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
CREATE TABLE t1 (a CHAR(48));
@@ -15,6 +11,7 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
Variable_name Value
Slave_open_temp_tables 1
[on master]
+[on master1]
[on slave]
==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
@@ -22,14 +19,10 @@ Variable_name Value
Slave_open_temp_tables 0
==== Clean up ====
[on master]
+include/rpl_connect.inc [creating master]
DROP TABLE t1;
[on slave]
-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;
+include/rpl_reset.inc
CREATE TABLE t1 (a int);
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
@@ -65,9 +58,54 @@ slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Xid # # COMMIT /* XID */
slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
-slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Xid # # COMMIT /* XID */
slave-bin.000001 # Query # # use `test`; DROP TABLE `t3`,`t1` /* generated by server */
+
+# Bug#55478 Row events wrongly apply on the temporary table of the same name
+# ==========================================================================
+# The statement should be binlogged
+CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
+
+# Case 1: CREATE TABLE t1 ... SELECT
+# ----------------------------------
+
+# The statement generates row events on t1. And the rows events should
+# be inserted into the base table on slave.
+CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
+ `rand()` double NOT NULL DEFAULT '0'
+) ENGINE=MyISAM
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+
+# Case 2: DROP TEMPORARY TABLE in a transacation
+# ----------------------------------------------
+
+BEGIN;
+DROP TEMPORARY TABLE t1;
+# The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
+# as t1 is non-transactional table
+INSERT INTO t1 VALUES(Rand());
+COMMIT;
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # 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 # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+master-bin.000001 # Query # # COMMIT
+# Compare the base table.
+include/diff_tables.inc [master:t1, slave:t1]
+
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 1e73e4ecad7..dfab66d074f 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -1,11 +1,6 @@
-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 sql_log_bin = 0;
-SET sql_log_bin = 1;
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
reset master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 (a char(1));
@@ -130,8 +125,8 @@ select * from t1;
a
1
drop table t1;
-SET sql_log_bin = 0;
-SET sql_log_bin = 1;
+include/stop_slave.inc
+include/rpl_reset.inc
-- Bug#43748
-- make a user on the slave that can list but not kill system threads.
FLUSH PRIVILEGES;
@@ -143,5 +138,5 @@ KILL @id;
Got one of the listed errors
-- throw out test-user on slave.
DROP USER user43748@127.0.0.1;
--- done. back to master.
End of 5.1 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
index 64fa4ed14ea..4a9a8e1dad4 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Deadlock found");
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
@@ -39,7 +35,8 @@ a b
2 2
3 3
4 4
-Checking that both slave threads are running.
-DROP TABLE t1;
+include/check_slave_is_running.inc
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
**** On Master ****
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_test_framework.result b/mysql-test/suite/rpl/r/rpl_test_framework.result
new file mode 100644
index 00000000000..e45c12ba0ec
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_test_framework.result
@@ -0,0 +1,170 @@
+==== Create t1 on all servers. ====
+include/rpl_init.inc [topology=1->2->3->4->5->6->7->8->9]
+CREATE TABLE t1 (a INT);
+include/rpl_end.inc
+==== Test 3-server topologies ====
+include/rpl_init.inc [topology=1 -> 2]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 12'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=2 -> 3]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 23'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (2);
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (2);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=none]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ''
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3);
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2, 2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 212'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 212'
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (5);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (5);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=2->1->2]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 212'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (6);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (6);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2->3]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 123'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (7);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=2->3->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 323 21'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (8);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2,2->3,3->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 23123'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (9);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->3->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 13213'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (10);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+==== Test 6-server topologies ====
+include/rpl_init.inc [topology=1->2->3->4->1->5->6]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 341234156'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (11);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=3->4->5->6->3->1->2]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 4563456 312'
+[connection server_4]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (12);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=6->5->4->3->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 65 54 43 32 21'
+[connection server_6]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (13);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2->3->1,4->5->6]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 456 23123'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (14);
+[connection server_4]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (14);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+==== Test 9-server topology ====
+include/rpl_init.inc [topology=1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 345123451689 67'
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (15);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1,server_7:t1,server_8:t1,server_9:t1]
+include/rpl_end.inc
+==== Clean up ====
+include/rpl_init.inc [topology=1->2->3->4->5->6->7->8->9]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
index 0b5c03b5300..ce93c3030c0 100644
--- a/mysql-test/suite/rpl/r/rpl_timezone.result
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
set @my_time_zone= @@global.time_zone;
set timestamp=100000000;
create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
@@ -122,6 +118,7 @@ a b
SET @@session.time_zone = default;
DROP TABLE t1;
SET @@session.time_zone = default;
+include/stop_slave.inc
reset master;
CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
SET @@session.time_zone='+01:00';
@@ -141,4 +138,5 @@ date a
2008-12-23 19:39:39 2
DROP TABLE t1;
SET @@session.time_zone = default;
+include/rpl_end.inc
End of 5.0 tests
diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
index 3136599e5aa..550b3f596e5 100644
--- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
+++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE TEMPORARY TABLE t1 (a INT);
CREATE TABLE t2 (a INT, b INT) ENGINE= MyISAM;
INSERT INTO t1 VALUES (1);
@@ -123,16 +119,16 @@ DROP PROCEDURE p2;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("DROP PROCEDURE p2 with table locked");
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("CREATE EVENT e1 with table locked");
UNLOCK TABLE;
CREATE EVENT e2 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
LOCK TABLE t1 WRITE;
ALTER EVENT e2 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("ALTER EVENT e2 with table locked");
DROP EVENT e2;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("DROP EVENT e2 with table locked");
CREATE DATABASE mysqltest1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
@@ -191,3 +187,4 @@ DROP FUNCTION f2;
DROP PROCEDURE p2;
DROP EVENT e2;
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 01d886c4709..784cd1bcdff 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
@@ -862,8 +858,8 @@ drop table t21,t31;
drop table t11;
STOP SLAVE;
FLUSH LOGS;
---> Stop master server
---> Start master server
+include/rpl_stop_server.inc [server_number=1]
+include/rpl_start_server.inc [server_number=1]
--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
RESET SLAVE;
START SLAVE;
@@ -976,12 +972,7 @@ 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;
+include/rpl_reset.inc
create table t1 ( f int ) engine = innodb;
create table log ( r int ) engine = myisam;
create trigger tr
@@ -992,6 +983,7 @@ 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
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:log, slave:log]
drop table t1, log;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
index 44624a38875..ae2c9973c9f 100644
--- a/mysql-test/suite/rpl/r/rpl_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
create temporary table t1 (n int);
insert into t1 values(1);
show status like 'Slave_open_temp_tables';
@@ -20,3 +16,4 @@ Slave_open_temp_tables 1
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index 38fb9e27764..da8db64cef4 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
@@ -1,20 +1,12 @@
-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;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -22,19 +14,15 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -42,5 +30,6 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index b5e5936834d..d8a4443022d 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
@@ -1,20 +1,12 @@
-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;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -22,19 +14,15 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -42,5 +30,6 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result
index 89096153c14..f9d5b50b4e2 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
set @saved_slave_type_conversions = @@global.slave_type_conversions;
CREATE TABLE type_conversions (
TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -41,32 +37,16 @@ SELECT @@global.slave_type_conversions;
ALL_LOSSY,ALL_NON_LOSSY
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** Result of conversions ****
Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
TINYBLOB TINYBLOB <Correct value>
@@ -554,5 +534,7 @@ BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
DROP TABLE type_conversions;
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677");
DROP TABLE t1;
set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
index 0b4286c54eb..67ac642bc5a 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
@@ -1,18 +1,10 @@
-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;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/master-slave.inc
+[connection master]
SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (b'0', b'01', b'101');
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result
index 92ffb9cffc7..f9a5765d3a3 100644
--- a/mysql-test/suite/rpl/r/rpl_udf.result
+++ b/mysql-test/suite/rpl/r/rpl_udf.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
"*** Test 1) Test UDFs via loadable libraries ***
"Running on the master"
@@ -155,3 +151,4 @@ affected rows: 0
"Running on the master"
DROP TABLE t1;
affected rows: 0
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_user.result b/mysql-test/suite/rpl/r/rpl_user.result
index a98e7e9ca55..4ad87eb1ae7 100644
--- a/mysql-test/suite/rpl/r/rpl_user.result
+++ b/mysql-test/suite/rpl/r/rpl_user.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
set session sql_log_bin=0;
delete from mysql.user where Host='fakehost';
set session sql_log_bin=1;
@@ -43,3 +39,4 @@ master-bin.000001 # Query # # use `test`; rename user 'foo'@'fakehost' to 'foofo
master-bin.000001 # Query # # use `test`; rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost'
master-bin.000001 # Query # # use `test`; drop user 'foofoo'@'fakehost'
master-bin.000001 # Query # # use `test`; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_user_variables.result b/mysql-test/suite/rpl/r/rpl_user_variables.result
index 1f76eae3fce..e302ec0aceb 100644
--- a/mysql-test/suite/rpl/r/rpl_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_user_variables.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
reset master;
create table t1(n char(30));
set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
@@ -279,4 +275,4 @@ i
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
-stop slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index b3108c75a6e..8711dce4ab6 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
==== Initialization ====
[on master]
SET @m_default_week_format= @@global.default_week_format;
@@ -38,13 +34,8 @@ SET @@global.sql_mode = 'ALLOW_INVALID_DATES';
SET @@local.sql_mode = 'ANSI_QUOTES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE';
SET @user_num = 10;
SET @user_text = 'Alunda';
-[on master]
-**** Resetting master and slave ****
include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
include/start_slave.inc
-[on slave]
SET @@global.init_slave = 'SELECT 1';
[on master]
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
@@ -550,15 +541,7 @@ id truth num text
30 NULL 30 NULL
31 NULL NULL Bergsbrunna
32 NULL NULL Centrum
-Comparing tables master:test.tstmt and master:test.tproc
-Comparing tables master:test.tstmt and master:test.tfunc
-Comparing tables master:test.tstmt and master:test.ttrig
-Comparing tables master:test.tstmt and master:test.tprep
-Comparing tables master:test.tstmt and slave:test.tstmt
-Comparing tables master:test.tstmt and slave:test.tproc
-Comparing tables master:test.tstmt and slave:test.tfunc
-Comparing tables master:test.tstmt and slave:test.ttrig
-Comparing tables master:test.tstmt and slave:test.tprep
+include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep]
==== Clean up ====
[on master]
DROP PROCEDURE proc;
@@ -582,3 +565,4 @@ SET @@global.relay_log_purge= @s_relay_log_purge;
SET @@global.slave_exec_mode= @s_slave_exec_mode;
SET @@global.sql_mode= @s_sql_mode;
SET @@global.sync_binlog= @s_sync_binlog;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables_stm.result b/mysql-test/suite/rpl/r/rpl_variables_stm.result
index 29bdf771237..dfd78742e75 100644
--- a/mysql-test/suite/rpl/r/rpl_variables_stm.result
+++ b/mysql-test/suite/rpl/r/rpl_variables_stm.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
==== Initialization ====
[on master]
@@ -488,15 +484,7 @@ id num text
56 NULL 47124712
57 NULL 1616
58 NULL 1717
-Comparing tables master:test.tstmt and master:test.tproc
-Comparing tables master:test.tstmt and master:test.tfunc
-Comparing tables master:test.tstmt and master:test.ttrig
-Comparing tables master:test.tstmt and master:test.tprep
-Comparing tables master:test.tstmt and slave:test.tstmt
-Comparing tables master:test.tstmt and slave:test.tproc
-Comparing tables master:test.tstmt and slave:test.tfunc
-Comparing tables master:test.tstmt and slave:test.ttrig
-Comparing tables master:test.tstmt and slave:test.tprep
+include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep]
==== Clean up ====
[on master]
DROP PROCEDURE proc;
@@ -520,3 +508,4 @@ SET @@global.collation_server= @s_collation_server;
SET @@global.time_zone= @s_time_zone;
SET @@global.lc_time_names= @s_lc_time_names;
SET @@global.collation_database= @s_collation_database;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result
index b129223b6d2..307b88ff6f9 100644
--- a/mysql-test/suite/rpl/r/rpl_view.result
+++ b/mysql-test/suite/rpl/r/rpl_view.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
drop table if exists t1,v1;
drop view if exists t1,v1;
reset master;
@@ -116,3 +112,4 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
DROP VIEW v1;
DROP TABLE t1;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view_multi.result b/mysql-test/suite/rpl/r/rpl_view_multi.result
index b3f10584a24..e42c8e51411 100644
--- a/mysql-test/suite/rpl/r/rpl_view_multi.result
+++ b/mysql-test/suite/rpl/r/rpl_view_multi.result
@@ -1,9 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
#
# Bug #25144 "replication / binlog with view breaks".
# Statements that used views didn't ensure that view were not modified
@@ -88,3 +84,4 @@ i
drop table t1, t2;
drop view v1;
# Syncing slave with master and switching to connection 'slave'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index d962394d91b..a45fdb47ae6 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,8 +10,8 @@
#
##############################################################################
-rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table).
-rpl_read_only : WL#4284: Setting Read only won't succeed until all metadata locks are released.
-rpl_row_create_table : Bug#51574 2010-02-27 andrei failed different way than earlier with bug#45576
-rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
-rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle
+rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576
+rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
+rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
+rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
+rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
diff --git a/mysql-test/suite/rpl/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh
deleted file mode 100644
index 1d95798260a..00000000000
--- a/mysql-test/suite/rpl/t/rpl000017-slave.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/log/*relay*
-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
-replicate
-aaaaaaaaaaaaaaab
-$MASTER_MYPORT
-1
-0
-EOF
diff --git a/mysql-test/suite/rpl/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test
deleted file mode 100644
index a65189657cc..00000000000
--- a/mysql-test/suite/rpl/t/rpl000017.test
+++ /dev/null
@@ -1,34 +0,0 @@
-# The test manually replaces the relay-log.info file with connection
-# information which the slave then should pick up. However, to avoid
-# overwriting the file, no CHANGE MASTER TO nor RESET SLAVE statements
-# should be executed.
-#
-# Starting replication before granting a replication user privileges
-# to replicate will cause the start slave to fail, so we shouldn't do
-# that.
-
-let $no_change_master = 1;
-let $skip_slave_start = 1;
-source include/master-slave.inc;
-
-connection master;
-grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
-grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
-connection slave;
-start slave;
-source include/wait_for_slave_to_start.inc;
-
-connection master;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1(n int);
-insert into t1 values(24);
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-delete from mysql.user where user="replicate";
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl000010-slave.opt b/mysql-test/suite/rpl/t/rpl_000010-slave.opt
index 0dbfb311e33..0dbfb311e33 100644
--- a/mysql-test/suite/rpl/t/rpl000010-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_000010-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl000010.test b/mysql-test/suite/rpl/t/rpl_000010.test
index a95cded6496..de6337dd723 100644
--- a/mysql-test/suite/rpl/t/rpl000010.test
+++ b/mysql-test/suite/rpl/t/rpl_000010.test
@@ -13,3 +13,4 @@ drop table t1;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl000011.test b/mysql-test/suite/rpl/t/rpl_000011.test
index baff7c1a1b5..625b0c22c62 100644
--- a/mysql-test/suite/rpl/t/rpl000011.test
+++ b/mysql-test/suite/rpl/t/rpl_000011.test
@@ -17,3 +17,4 @@ drop table t1;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl000013.test b/mysql-test/suite/rpl/t/rpl_000013.test
index 7f80252a9fc..9f1b06665dd 100644
--- a/mysql-test/suite/rpl/t/rpl000013.test
+++ b/mysql-test/suite/rpl/t/rpl_000013.test
@@ -9,8 +9,6 @@
--source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
-sync_slave_with_master;
-connection master;
--disable_query_log
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
@@ -52,6 +50,6 @@ connection master2;
# exist in this connection.
drop table if exists t1,t2;
-sync_slave_with_master;
+--source include/rpl_end.inc
# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_000017.test b/mysql-test/suite/rpl/t/rpl_000017.test
new file mode 100644
index 00000000000..a34419c37c8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000017.test
@@ -0,0 +1,48 @@
+# ==== Purpose ====
+#
+# Unknown.
+#
+# ==== Notes ====
+#
+# This test uses the -slave.opt file to start the slave with
+# --skip-slave-start.
+
+--source include/not_windows.inc
+
+--let $rpl_skip_start_slave= 1
+--source include/master-slave.inc
+
+--connection slave
+--let $slave_datadir= `SELECT @@datadir`
+
+--remove_file $slave_datadir/master.info
+--write_file $slave_datadir/master.info
+master-bin.000001
+4
+127.0.0.1
+replicate
+aaaaaaaaaaaaaaab
+$MASTER_MYPORT
+1
+0
+EOF
+
+connection master;
+grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
+connection slave;
+--source include/start_slave.inc
+
+connection master;
+create table t1(n int);
+insert into t1 values(24);
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+delete from mysql.user where user="replicate";
+
+# End of 4.1 tests
+--source include/rpl_end.inc
+
+--source include/force_restart.inc
diff --git a/mysql-test/suite/rpl/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test
index 6d064ae3197..5272b11f342 100644
--- a/mysql-test/suite/rpl/t/rpl_EE_err.test
+++ b/mysql-test/suite/rpl/t/rpl_EE_err.test
@@ -1,7 +1,3 @@
-########################################################
-# By JBM 2006-02-14 Wrapped to share test code between #
-# engines. Added to skip test when NDB is default #
-########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_EE_err.test
diff --git a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
index ae647ed6648..0f02bdccb60 100644
--- a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
+++ b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
@@ -36,3 +36,4 @@ sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test
index 6a6da9c9f24..630197f8637 100644
--- a/mysql-test/suite/rpl/t/rpl_alter.test
+++ b/mysql-test/suite/rpl/t/rpl_alter.test
@@ -1,7 +1,4 @@
source include/master-slave.inc;
---disable_warnings
-drop database if exists mysqltest;
---enable_warnings
create database mysqltest;
create table mysqltest.t1 ( n int);
@@ -18,3 +15,4 @@ drop database mysqltest;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test
index 341496350d7..f6f0782580f 100644
--- a/mysql-test/suite/rpl/t/rpl_alter_db.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_db.test
@@ -12,3 +12,4 @@ sync_slave_with_master;
connection master;
drop database temp_db;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test
index 19770ffbdc0..8869e3745db 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment.test
@@ -1,10 +1,6 @@
#####################################
# Wrapper for rpl_auto_increment.test#
#####################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=innodb;
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
index 8c95e158847..d1da69533ec 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
@@ -56,6 +56,6 @@ sync_slave_with_master;
use test1;
select * from t1;
-drop database test1;
connection master;
drop database test1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test b/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test
new file mode 100644
index 00000000000..6f7e0d80b5c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test
@@ -0,0 +1,60 @@
+# BUG#33029 5.0 to 5.1 replication fails on dup key when inserting
+# using a trig in SP
+
+# For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive,
+# if one statement in a SP generated AUTO_INCREMENT value by the top
+# statement, all statements after it would be considered generated
+# AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID
+# value might be associated with these statement, which could cause
+# duplicate entry error and stop the slave.
+
+# Test if the slave can replicate from such a buggy master
+
+# The bug33029-slave-relay-bin.000001 file is the
+# slave-replay-bin.000003 file generated by run the
+# rpl_auto_increment_bug33029.test with clean up statements at the end
+# of the test case removed on a buggy 5.0 server
+
+--let $rpl_skip_start_slave= 1
+--source include/master-slave.inc
+
+--echo ==== Initialize ====
+--connection slave
+
+# The binlog we read does funny things with triggers and causes this warning.
+--disable_query_log
+CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
+--enable_query_log
+
+# Need to restore this at the end; CHANGE MASTER modifies it (see the
+# manual for CHANGE MASTER).
+SET @old_relay_log_purge= @@global.relay_log_purge;
+
+# the relay log contains create t1, t2 tables and load data infile
+--let $fake_relay_log = $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
+--source include/setup_fake_relay_log.inc
+
+--echo ==== Test ====
+start slave sql_thread;
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= 3776
+--source include/wait_for_slave_param.inc
+
+
+echo # Result on slave;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--echo ==== Clean up ====
+
+stop slave sql_thread;
+--source include/cleanup_fake_relay_log.inc
+
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+
+SET @@global.relay_log_purge= @old_relay_log_purge;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test b/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
index f38d2151ab3..b5eb3c5408a 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
@@ -159,11 +159,9 @@ source include/show_binlog_events.inc;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT'
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@@ -199,11 +197,9 @@ source include/show_binlog_events.inc;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES'
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@@ -212,3 +208,4 @@ drop table t2;
drop view v15;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
index acb98a0ad88..b4798691ca3 100644
--- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
+++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
@@ -177,4 +177,4 @@ SELECT * FROM db1.t1 WHERE a IN (30, 40);
connection master;
DROP DATABASE db1;
DROP DATABASE db2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt
deleted file mode 100644
index 74e71a8e558..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-same-server-id --relay-log=slave-relay-bin --skip-slave-start
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test b/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test
deleted file mode 100644
index dbdd96347a2..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test
+++ /dev/null
@@ -1,42 +0,0 @@
-# BUG#33029 5.0 to 5.1 replication fails on dup key when inserting
-# using a trig in SP
-
-# For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive,
-# if one statement in a SP generated AUTO_INCREMENT value by the top
-# statement, all statements after it would be considered generated
-# AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID
-# value might be associated with these statement, which could cause
-# duplicate entry error and stop the slave.
-
-# Test if the slave can replicate from such a buggy master
-
-# The bug33029-slave-relay-bin.000001 file is the
-# slave-replay-bin.000003 file generated by run the
-# rpl_auto_increment_bug33029.test with clean up statements at the end
-# of the test case removed on a buggy 5.0 server
-
-source include/have_log_bin.inc;
-
-let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001;
-source include/setup_fake_relay_log.inc;
-
-start slave sql_thread;
-disable_result_log;
-select MASTER_POS_WAIT('master-bin.000001', 3776);
-enable_result_log;
-
-echo # Result on slave;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-# clean up
-disable_warnings;
-DROP TABLE IF EXISTS t1, t2;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP FUNCTION IF EXISTS f1;
-DROP TRIGGER IF EXISTS tr1;
-enable_warnings;
-
-stop slave sql_thread;
-source include/cleanup_fake_relay_log.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
deleted file mode 100644
index 815a8f81d32..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---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
index 401597b5c64..6717bda0fa7 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
@@ -15,15 +15,14 @@
# BUG#31793: log event corruption causes crash
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
-# Temporarily disabled on Windows due to bug #47639
---source include/not_windows.inc
+--source include/master-slave.inc
-source include/have_log_bin.inc;
# BUG#40482 only manifested itself in debug-compiled binaries.
source include/have_debug.inc;
+--connection slave
call mtr.add_suppression('Found invalid event in binary log');
-
+call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
#
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
@@ -32,6 +31,9 @@ call mtr.add_suppression('Found invalid event in binary log');
# incident number.
--echo ==== Initialize ====
+--source include/stop_slave.inc
+RESET SLAVE;
+
let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
source include/setup_fake_relay_log.inc;
@@ -44,3 +46,5 @@ let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo ==== Clean up ====
source include/cleanup_fake_relay_log.inc;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt
new file mode 100644
index 00000000000..f8e46a44854
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt
@@ -0,0 +1 @@
+--max_binlog_size=4096
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
new file mode 100644
index 00000000000..7c09dab704e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -0,0 +1,413 @@
+# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
+# when generating new name.
+#
+# WHY
+# ===
+#
+# We want to check whether error is reported or not when
+# new_file_impl fails (this may happen when rotation is not
+# possible because there is some problem finding an
+# unique filename).
+#
+# HOW
+# ===
+#
+# Test cases are documented inline.
+
+-- source include/have_innodb.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+-- echo #######################################################################
+-- echo ####################### PART 1: MASTER TESTS ##########################
+-- echo #######################################################################
+
+
+### ACTION: stopping slave as it is not needed for the first part of
+### the test
+
+-- connection slave
+-- source include/stop_slave.inc
+-- connection master
+
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+
+SET @old_debug= @@global.debug;
+
+### ACTION: create a large file (> 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check binlog errors in its vacinity
+-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
+
+### ACTION: create a small file (< 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check for absence of binlog errors
+### when file loading this file does not force flushing and
+### rotating the binary log
+-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
+
+RESET MASTER;
+
+-- echo ###################### TEST #1
+
+### ASSERTION: no problem flushing logs (should show two binlogs)
+FLUSH LOGS;
+-- echo # assert: must show two binlogs
+-- source include/show_binary_logs.inc
+
+-- echo ###################### TEST #2
+
+### ASSERTION: check that FLUSH LOGS actually fails and reports
+### failure back to the user if find_uniq_filename fails
+### (should show just one binlog)
+
+RESET MASTER;
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+-- echo # assert: must show one binlog
+-- source include/show_binary_logs.inc
+
+### ACTION: clean up and move to next test
+SET GLOBAL debug="";
+RESET MASTER;
+
+-- echo ###################### TEST #3
+
+### ACTION: create some tables (t1, t2, t4) and insert some values in
+### table t1
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+
+### ASSERTION: we force rotation of the binary log because it exceeds
+### the max_binlog_size option (should show two binary
+### logs)
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# shows two binary logs
+-- echo # assert: must show two binlog
+-- source include/show_binary_logs.inc
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #4
+
+### ASSERTION: load the big file into a transactional table and check
+### that it reports error. The table will contain the
+### changes performed despite the fact that it reported an
+### error.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #5
+
+### ASSERTION: load the small file into a transactional table and
+### check that it succeeds
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #6
+
+### ASSERTION: check that even if one is using a transactional table
+### and explicit transactions (no autocommit) if rotation
+### fails we get the error. Transaction is not rolledback
+### because rotation happens after the commit.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+INSERT INTO t2 VALUES ('muse');
+-- error ER_NO_UNIQUE_LOGFILE
+COMMIT;
+
+### ACTION: Show the contents of the table after the test
+-- echo # assert: must show three entries
+SELECT count(*) FROM t2;
+
+### ACTION: clean up and move to the next test
+SET AUTOCOMMIT= 1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #7
+
+### ASSERTION: check that on a non-transactional table, if rotation
+### fails then an error is reported and an incident event
+### is written to the current binary log.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+SELECT count(*) FROM t4;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+
+-- echo ### check that the incident event is written to the current log
+SET GLOBAL debug="-d,error_unique_log_filename";
+-- let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+-- let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+# 53 is the size of the incident event, so we start from 22 bytes before the
+# current position
+-- let $binlog_start = `SELECT $binlog_start - 53`
+FLUSH LOGS;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start> $binlog_file BINLOG_FILE
+-- replace_column 2 # 4 # 5 #
+-- eval SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_start LIMIT 1
+
+# clean up and move to next test
+DELETE FROM t4;
+RESET MASTER;
+
+-- echo ###################### TEST #8
+
+### ASSERTION: check that statements end up in error but they succeed
+### on changing the data.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- echo # must show 0 entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+-- error ER_NO_UNIQUE_LOGFILE
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+
+-- echo # INFO: Count(*) Before Offending DELETEs
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+-- echo # assert: must show 4 entries
+SELECT count(*) FROM t2;
+
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t4;
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t2;
+
+-- echo # INFO: Count(*) After Offending DELETEs
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+# remove fault injection
+SET GLOBAL debug="-d,error_unique_log_filename";
+
+-- echo ###################### TEST #9
+
+### ASSERTION: check that if we disable binlogging, then statements
+### succeed.
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+-- echo # assert: must show four entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+DELETE FROM t2;
+DELETE FROM t4;
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+SET SQL_LOG_BIN=1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+
+-- echo ###################### TEST #10
+
+### ASSERTION: check that error is reported if there is a failure
+### while registering the index file and the binary log
+### file or failure to write the rotate event.
+
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not open .*");
+
+RESET MASTER;
+SHOW WARNINGS;
+
+# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
+SET GLOBAL debug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET GLOBAL debug="-d,fault_injection_registering_index";
+
+-- error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+-- echo ###################### TEST #11
+
+### ASSERTION: check that error is reported if there is a failure
+### while opening the index file and the binary log file or
+### failure to write the rotate event.
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
+SET GLOBAL debug="+d,fault_injection_openning_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET GLOBAL debug="-d,fault_injection_openning_index";
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+-- echo ###################### TEST #12
+
+### ASSERTION: check that error is reported if there is a failure
+### while writing the rotate event when creating a new log
+### file.
+
+# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
+SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
+-- error ER_ERROR_ON_WRITE
+FLUSH LOGS;
+SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+## clean up
+SET GLOBAL debug= @old_debug;
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+
+# restart slave again
+-- connection slave
+-- source include/start_slave.inc
+-- connection master
+
+-- echo #######################################################################
+-- echo ####################### PART 2: SLAVE TESTS ###########################
+-- echo #######################################################################
+
+### setup
+--source include/rpl_reset.inc
+-- connection slave
+
+# slave suppressions
+
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+-- echo ###################### TEST #13
+
+#### ASSERTION: check against unique log filename error
+-- let $io_thd_injection_fault_flag= error_unique_log_filename
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #14
+
+#### ASSERTION: check against rotate failing
+-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #15
+
+#### ASSERTION: check against relay log open failure
+-- let $io_thd_injection_fault_flag= fault_injection_registering_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #16
+
+#### ASSERTION: check against relay log index open failure
+-- let $io_thd_injection_fault_flag= fault_injection_openning_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+### clean up
+-- source include/stop_slave_sql.inc
+SET GLOBAL debug=@old_debug;
+RESET SLAVE;
+RESET MASTER;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
index 4c6402359fe..839399dea63 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -10,9 +10,6 @@ let $VERSION=`select version()`;
# Now GRANT/REVOKE do implicitly commit
# transaction
---disable_warnings
-drop database if exists d1;
---enable_warnings
create database d1;
use d1;
create table t (s1 int) engine=innodb;
@@ -40,4 +37,5 @@ select * from t;
show grants for x@y;
drop user x@y;
drop database d1;
---sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt
deleted file mode 100644
index 33632bf98e8..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-do-db='impossible_database'
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
deleted file mode 100644
index d56a32ce2bd..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
+++ /dev/null
@@ -1,32 +0,0 @@
-# regression test for
-# Bug#36099 replicate-do-db affects replaying RBR events with mysqlbinlog
-# The test verifies that the slave side filtering rule does not affect
-# applying of row-events on master via mysqlbinlog
-
--- source include/have_log_bin.inc
--- source include/not_embedded.inc
--- source include/have_binlog_format_row.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-reset master;
-
-create table t1 (a int);
-insert into t1 values (1);
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-flush logs;
---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"
-
---echo *** must be 1 ***
-select * from t1;
-
-# cleanup
-
-drop table t1;
-remove_file $MYSQLTEST_VARDIR/tmp/bug36099.sql;
diff --git a/mysql-test/suite/rpl/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test
index c648159ff3a..67606e5d509 100644
--- a/mysql-test/suite/rpl/t/rpl_bit.test
+++ b/mysql-test/suite/rpl/t/rpl_bit.test
@@ -90,3 +90,4 @@ DROP TABLE IF EXISTS test.t1;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bit_npk.test b/mysql-test/suite/rpl/t/rpl_bit_npk.test
index 1df7341eafc..d65ef66ae41 100644
--- a/mysql-test/suite/rpl/t/rpl_bit_npk.test
+++ b/mysql-test/suite/rpl/t/rpl_bit_npk.test
@@ -110,3 +110,4 @@ DROP TABLE IF EXISTS test.t3;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test
index 647e65d89fd..5f9b955aaa4 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole.test
@@ -96,4 +96,5 @@ 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;
+DROP TABLE t1,t2;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
index 97c152d52e9..aeb0da9511d 100644
--- a/mysql-test/suite/rpl/t/rpl_bug26395.test
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -95,3 +95,5 @@ connection slave;
DROP TABLE tinnodb;
# Warning: do not add more tests here. The binlog is in a bad state.
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test
index 9461a91e933..028ca32636a 100644
--- a/mysql-test/suite/rpl/t/rpl_bug31076.test
+++ b/mysql-test/suite/rpl/t/rpl_bug31076.test
@@ -141,3 +141,4 @@ DROP DATABASE track;
sync_slave_with_master;
--echo End of 5.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931-master.opt b/mysql-test/suite/rpl/t/rpl_bug33931-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug33931-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test
index 5dc06e6a605..5cc2da4a001 100644
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test
@@ -3,19 +3,16 @@
# Bug #33932 assertion at handle_slave_sql if init_slave_thread() fails
source include/have_debug.inc;
-source include/have_log_bin.inc;
-
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-
-connection master;
-reset master;
+source include/master-slave.inc;
connection slave;
-reset slave;
# Add suppression for expected warnings in slaves error log
call mtr.add_suppression("Failed during slave I/O thread initialization");
+call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593");
+
+--source include/stop_slave.inc
+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";
@@ -29,18 +26,13 @@ eval CHANGE MASTER TO MASTER_USER='root',
start slave;
-connection master;
-save_master_pos;
-connection slave;
-
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
-source include/wait_for_slave_to_stop.inc;
# 1593 = ER_SLAVE_FATAL_ERROR
---let $slave_sql_errno= 1593
+--let $slave_sql_errno= 1593
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
@@ -49,3 +41,8 @@ source include/wait_for_slave_to_stop.inc;
#
SET GLOBAL debug="";
+# Clear Last_SQL_Error
+RESET SLAVE;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug37426.test b/mysql-test/suite/rpl/t/rpl_bug37426.test
new file mode 100644
index 00000000000..d0a60524fef
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug37426.test
@@ -0,0 +1,22 @@
+#############################################################
+# Purpose: Test for BUG#37426
+# RBR breaks for CHAR() UTF8 fields > 85 chars
+#############################################################
+
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+
+connection master;
+CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
+INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
+
+SELECT * FROM char128_utf8;
+sync_slave_with_master;
+
+SELECT * FROM char128_utf8;
+
+# Clean up
+connection master;
+DROP TABLE char128_utf8;
+sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug38694.test b/mysql-test/suite/rpl/t/rpl_bug38694.test
index 41b11d271b9..48f950ad6ef 100644
--- a/mysql-test/suite/rpl/t/rpl_bug38694.test
+++ b/mysql-test/suite/rpl/t/rpl_bug38694.test
@@ -8,3 +8,4 @@
source include/master-slave.inc;
# End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug41902.test b/mysql-test/suite/rpl/t/rpl_bug41902.test
index d16fb986cea..12eeb903003 100644
--- a/mysql-test/suite/rpl/t/rpl_bug41902.test
+++ b/mysql-test/suite/rpl/t/rpl_bug41902.test
@@ -58,4 +58,7 @@ call mtr.add_suppression("Failed to locate old binlog or relay log files");
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index");
--enable_query_log
---echo End of the tests
+--echo ==== clean up ====
+CHANGE MASTER TO MASTER_HOST = '127.0.0.1';
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test
index 514d6cf8c0f..c31359a84d8 100644
--- a/mysql-test/suite/rpl/t/rpl_change_master.test
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test
@@ -23,7 +23,7 @@ source include/stop_slave.inc;
let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-if (`SELECT $read_pos = $exec_pos`)
+if ($read_pos == $exec_pos)
{
source include/show_rpl_debug_info.inc;
echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos';
@@ -32,7 +32,7 @@ if (`SELECT $read_pos = $exec_pos`)
change master to master_user='root';
let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-if (`SELECT $read_pos <> $exec_pos`)
+if ($read_pos != $exec_pos)
{
source include/show_rpl_debug_info.inc;
echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos';
@@ -52,7 +52,8 @@ sync_slave_with_master;
# BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
#
-source include/master-slave-reset.inc;
+if ($bug_59037_is_fixed == 'true') {
+--source include/rpl_reset.inc
connection master;
create table t1 (a int);
@@ -65,8 +66,7 @@ insert into t1 values (2);
sync_slave_with_master;
# Check if the table t1 and t2 are identical on master and slave;
-let $diff_table_1= master:test.t1
-let $diff_table_2= slave:test.t1
+let $diff_tables= master:t1,slave:t1
source include/diff_tables.inc;
connection slave;
@@ -88,8 +88,7 @@ source include/wait_for_slave_sql_to_start.inc;
sync_with_master;
# Check if the table t1 and t2 are identical on master and slave;
-let $diff_table_1= master:test.t1
-let $diff_table_2= slave:test.t1
+let $diff_tables= master:t1,slave:t1
source include/diff_tables.inc;
# clean up
@@ -99,4 +98,6 @@ source include/wait_for_slave_io_to_start.inc;
eval set global relay_log_purge=$relay_log_purge;
connection master;
drop table t1;
-sync_slave_with_master;
+}
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_charset.test b/mysql-test/suite/rpl/t/rpl_charset.test
index ed0d835f22d..3ed9147508e 100644
--- a/mysql-test/suite/rpl/t/rpl_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_charset.test
@@ -1,3 +1,2 @@
let $engine_type=myisam;
source extra/rpl_tests/rpl_charset.test;
-
diff --git a/mysql-test/suite/rpl/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
index 2469b0db8a2..a3a3de8c1d0 100644
--- a/mysql-test/suite/rpl/t/rpl_charset_sjis.test
+++ b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
@@ -23,3 +23,4 @@ sync_slave_with_master;
connection master;
# End of 5.0 tests
+--source include/rpl_end.inc
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
index 536551ec3dc..3ff94e458ce 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
@@ -17,11 +17,8 @@ log-slave-updates
loose-innodb
[ENV]
-SLAVE_MYPORT1= @mysqld.3.port
-SLAVE_MYSOCK1= @mysqld.3.socket
-
-SLAVE_MYPORT2= @mysqld.4.port
-SLAVE_MYSOCK2= @mysqld.4.socket
-
-
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYSOCK_4= @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
index 2f1b86c2c31..7d4b538c8a6 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -1,27 +1,36 @@
-#############################################################
-# 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
-#############################################################
+# ==== Purpose ====
+#
+# Setup: circular replication on four hosts, i.e., topology
+# server_1 -> server_2 -> server_3 -> server_4 -> server_1
+#
+# Tested properties:
+# - Correctly configured autoinc works.
+# - Manual failover works.
+#
+# ==== Related bugs and worklogs ====
+#
+# WL#3754
+# BUG#49978
+
--source include/have_innodb.inc
# Use wait_for_slave_to_(start|stop) for current connections
let $keep_connection= 1;
# 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 *** Set up circular replication on four servers ***
+--let $rpl_topology= 1->2->3->4->1
+--source include/rpl_init.inc
--echo
# Preparing data.
--echo *** Preparing data ***
---connection master_a
+--connection server_1
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
+--source include/rpl_sync.inc
+--connection server_4
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
--echo
#
@@ -31,121 +40,135 @@ CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL,
--echo *** Testing schema A->B->C->D->A ***
--echo
# insert data via all hosts
---connection master_a
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',1);
---sync_slave_with_master master_b
+--sync_slave_with_master server_2
INSERT INTO t1(b,c) VALUES('B',1);
---sync_slave_with_master master_c
+--sync_slave_with_master server_3
INSERT INTO t1(b,c) VALUES('C',1);
---sync_slave_with_master master_d
+--sync_slave_with_master server_4
INSERT INTO t1(b,c) VALUES('D',1);
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
---connection master_d
+--connection server_4
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 *
+
+# Note: server_N has auto_increment_offset=N. Below, we insert value 6
+# in the autoinc column on server_3 (and prevent it from replicating
+# further using SQL_SLAVE_SKIP_COUNTER on server_4). Due to the
+# auto_increment_offset setting, the autoinc value 6 is normally
+# generated on server_2. When we later insert a row on server_2, we
+# thus cause a duplicate key error on server_3.
+
# Do not replicate next event from C
---connection master_d
-connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+--connection server_4
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
source include/start_slave.inc;
-disconnect slave;
---connection master_c
+--connection server_3
INSERT INTO t1 VALUES(6,'C',2);
---save_master_pos
---connection master_b
+--sync_slave_with_master server_4
+
+--connection server_2
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
+--connection server_3
+# 1062 = ER_DUP_ENTRY
+call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062");
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',2);
---connection master_d
+--connection server_4
INSERT INTO t1(b,c) VALUES('D',2);
# Sync all servers except C
---connection master_b
+--connection server_2
let $wait_condition= SELECT COUNT(*)=3 FROM t1 WHERE a > 4;
+--let $server_connection= server_1
--source include/wait_condition.inc
--echo
--echo * Data on servers (C failed) *
# Masters C,D shouldn't have correct data
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_d
+--connection server_4
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;
+--connection server_3
+--source include/stop_slave_io.inc
--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);
+
+--connection server_4
+--source include/stop_slave.inc
+
+--let $rpl_topology= 1->2->4->1,2->3
+--let $rpl_master_log_file= 4:$file_c
+--let $rpl_master_log_pos= 4:$pos_c
+--source include/rpl_change_topology.inc
+
+#--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 $file_c LOG_FILE $pos_c LOG_POS
+#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SERVER_MYPORT_2,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
source include/start_slave.inc;
-disconnect slave;
---connection master_b
---sync_slave_with_master master_d
---sync_slave_with_master master_a
+--connection server_2
+--sync_slave_with_master server_4
+--sync_slave_with_master server_1
--echo
--echo * Check data inserted before failure *
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
--echo
--echo * Check data inserted after failure *
---connection master_a
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',3);
---connection master_b
+--connection server_2
INSERT INTO t1(b,c) VALUES('B',3);
---connection master_d
+--connection server_4
INSERT INTO t1(b,c) VALUES('D',3);
-connection master_a;
+connection server_1;
---sync_slave_with_master master_b
---sync_slave_with_master master_d
---sync_slave_with_master master_a
---sync_slave_with_master master_b
+--let $rpl_only_running_threads= 1
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_a
+--connection server_1
--echo
--echo *** Testing restoring scheme A->B->C->D->A after failure ***
@@ -153,158 +176,150 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
# 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
+--connection server_4
source include/stop_slave.inc;
---connection master_c
+--connection server_3
DELETE FROM t1 WHERE a = 6;
-START SLAVE;
---connection master_b
---sync_slave_with_master master_c
+--source include/start_slave.inc
+--connection server_2
+--sync_slave_with_master server_3
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
+--connection server_4
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
+--let $rpl_topology= 1->2->3->4->1
+--let $rpl_master_log_file= 4:$file_d
+--let $rpl_master_log_pos= 4:$pos_d
+--source include/rpl_change_topology.inc
+#--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3 $file_d LOG_FILE $pos_d LOG_POS
+#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SERVER_MYPORT_3,master_user='root',master_log_file='$file_d',master_log_pos=$pos_d
+--source include/start_slave.inc
+--connection server_3
+--sync_slave_with_master server_4
+--source include/rpl_sync.inc
--echo
--echo * Check data inserted before restoring schema A->B->C->D->A *
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_b
+--sync_slave_with_master server_2
SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_c
+--sync_slave_with_master server_3
SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_d
+--sync_slave_with_master server_4
SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_a
+--sync_slave_with_master server_1
--echo
--echo * Check data inserted after restoring schema A->B->C->D->A *
---connection master_a
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',4);
---connection master_b
+--connection server_2
INSERT INTO t1(b,c) VALUES('B',4);
---connection master_c
+--connection server_3
INSERT INTO t1(b,c) VALUES('C',4);
---connection master_d
+--connection server_4
INSERT INTO t1(b,c) VALUES('D',4);
---connection master_a
+--connection server_1
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_a
+--connection server_1
--echo
--echo * Transactions with commits *
# Testing mixing of transactions and regular inserts
---connection master_a
+--connection server_1
BEGIN;
---connection master_c
+--connection server_3
BEGIN;
let $counter= 100;
---connection master_a
+--connection server_1
--disable_query_log
while ($counter) {
- --connection master_a
+ --connection server_1
INSERT INTO t2(b,c) VALUES('A',1);
- --connection master_b
+ --connection server_2
INSERT INTO t2(b,c) VALUES('B',1);
- --connection master_c
+ --connection server_3
INSERT INTO t2(b,c) VALUES('C',1);
- --connection master_d
+ --connection server_4
INSERT INTO t2(b,c) VALUES('D',1);
dec $counter;
}
---connection master_a
+--connection server_1
COMMIT;
---connection master_c
+--connection server_3
COMMIT;
---connection master_a
+--connection server_1
--enable_query_log
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_b
+--connection server_2
SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_c
+--connection server_3
SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_d
+--connection server_4
SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_a
+--connection server_1
--echo
--echo * Transactions with rollbacks *
# Testing mixing of transactions with rollback and regular inserts
---connection master_a
+--connection server_1
BEGIN;
---connection master_c
+--connection server_3
BEGIN;
let $counter= 100;
---connection master_a
+--connection server_1
--disable_query_log
while ($counter) {
- --connection master_a
+ --connection server_1
INSERT INTO t2(b,c) VALUES('A',2);
- --connection master_b
+ --connection server_2
INSERT INTO t2(b,c) VALUES('B',2);
- --connection master_c
+ --connection server_3
INSERT INTO t2(b,c) VALUES('C',2);
- --connection master_d
+ --connection server_4
INSERT INTO t2(b,c) VALUES('D',2);
dec $counter;
}
---connection master_a
+--connection server_1
ROLLBACK;
---connection master_c
+--connection server_3
ROLLBACK;
---connection master_a
+--connection server_1
--enable_query_log
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_b
+--connection server_2
SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_c
+--connection server_3
SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_d
+--connection server_4
SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_a
+--connection server_1
--echo
# Clean up
--echo *** Clean up ***
---connection master_a
+--connection server_1
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;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test
index 4c808ef3dfd..d6f817af189 100644
--- a/mysql-test/suite/rpl/t/rpl_colSize.test
+++ b/mysql-test/suite/rpl/t/rpl_colSize.test
@@ -225,3 +225,4 @@ sync_slave_with_master;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
# END 5.1 Test Case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
index 47df391d6be..5e070b14301 100644
--- a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
+++ b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
@@ -1,12 +1,6 @@
-#####################################
-# Wrapper for rpl_commit_after_flush#
-#####################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_commit_after_flush.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_concurrency_error.test b/mysql-test/suite/rpl/t/rpl_concurrency_error.test
index 2e216d25211..15d5d5502a1 100644
--- a/mysql-test/suite/rpl/t/rpl_concurrency_error.test
+++ b/mysql-test/suite/rpl/t/rpl_concurrency_error.test
@@ -53,24 +53,24 @@ while ($type)
{
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
connection conn1;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
eval UPDATE t SET f = 'yellow $type' WHERE i = 3;
connection conn2;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
@@ -88,24 +88,24 @@ while ($type)
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
connection conn1;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
eval UPDATE t SET f = 'gray $type' WHERE i = 3;
connection conn2;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
@@ -127,13 +127,11 @@ while ($type)
connection master;
sync_slave_with_master;
-connection master;
-let $diff_statement= SELECT * FROM t order by i;
-source include/diff_master_slave.inc;
+let $rpl_diff_statement= SELECT * FROM t order by i;
+source include/rpl_diff.inc;
-connection master;
-let $diff_statement= SELECT * FROM n order by d, f;
-source include/diff_master_slave.inc;
+let $rpl_diff_statement= SELECT * FROM n order by d, f;
+source include/rpl_diff.inc;
--echo ########################################################################
--echo # Cleanup
@@ -149,3 +147,4 @@ sync_slave_with_master;
connection master;
disconnect conn1;
disconnect conn2;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_conditional_comments.test b/mysql-test/suite/rpl/t/rpl_conditional_comments.test
index 14251d5eb37..88adf3a20f1 100644
--- a/mysql-test/suite/rpl/t/rpl_conditional_comments.test
+++ b/mysql-test/suite/rpl/t/rpl_conditional_comments.test
@@ -26,15 +26,15 @@ let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
source include/show_binlog_events.inc;
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
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_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo
--echo # Case 2:
--echo # -----------------------------------------------------------------
--echo # Verify whether it can be binlogged correctly when executing prepared
--echo # statement.
+--connection master
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla*/ t1 VALUES(60) /*!99999 ,(61)*/';
EXECUTE stmt;
DROP TABLE t1;
@@ -42,10 +42,10 @@ CREATE TABLE t1(c1 INT);
EXECUTE stmt;
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_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+--connection master
--echo
SET @value=62;
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/';
@@ -58,17 +58,17 @@ source include/show_binlog_events.inc;
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
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_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo
--echo # Case 3:
--echo # -----------------------------------------------------------------
--echo # Verify it can restore the '!', if the it is an uncomplete conditional
--echo # comments
+--connection master
--error 1064
SELECT c1 FROM /*!99999 t1 WHEREN;
DROP TABLE t1;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_database.test b/mysql-test/suite/rpl/t/rpl_create_database.test
index e3e2e637594..5eac3de0d15 100644
--- a/mysql-test/suite/rpl/t/rpl_create_database.test
+++ b/mysql-test/suite/rpl/t/rpl_create_database.test
@@ -70,3 +70,4 @@ DROP DATABASE IF EXISTS mysqltest_bob;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
index 6b459bb9c76..4e24b9a8133 100644
--- a/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
+++ b/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
@@ -125,7 +125,7 @@ DROP TABLE t3;
--echo # After the worklog, it will insert nothing and the statement will not be
--echo # binlogged if the table already exists.
--echo # After the worklog, some bugs will disappear automotically.
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
--echo
--echo # Case 1: BUG#47132
@@ -173,4 +173,4 @@ DROP VIEW v1;
DROP TABLE t1, t2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test
index a06dfa54cb1..daf6b7e9ad8 100644
--- a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test
+++ b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test
@@ -38,4 +38,4 @@ CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp;
source include/show_binlog_events.inc;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test
index aa1f251b738..bc0d7096f80 100644
--- a/mysql-test/suite/rpl/t/rpl_critical_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_critical_errors.test
@@ -35,7 +35,7 @@ connection master1;
# This sleep is picked so that the query above has started to insert
# some rows into t2. If it hasn't the slave will not stop below.
let $wait_condition= SELECT COUNT(*) > 1000 FROM t1;
-source include/wait_condition.inc
+--source include/wait_condition.inc
# SHOW PROCESSLIST;
@@ -62,4 +62,5 @@ connection slave;
# The following should be 0
SELECT COUNT(*) FROM t2;
+--source include/rpl_end.inc
enable_parsing;
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
index 815a8f81d32..b0a1ce4a0be 100644
--- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
@@ -1 +1,2 @@
--replicate-same-server-id --relay-log=slave-relay-bin
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test
index 8cd268a5fd9..94c9f0432ce 100644
--- a/mysql-test/suite/rpl/t/rpl_cross_version.test
+++ b/mysql-test/suite/rpl/t/rpl_cross_version.test
@@ -10,18 +10,23 @@
# The master's binlog is treated as a relay log that the SQL thread executes.
#
---source include/have_log_bin.inc
-
-# The test is disabled for windows due to
-# Bug #42879 CHANGE MASTER RELAY_LOG_FILE=path fails on windows
-# Todo: release it from not_windows
---source include/not_windows.inc
+--source include/master-slave.inc
#
# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails
#
--echo ==== Initialize ====
+--connection slave
+
+--disable_query_log
+# The binlog contains the function RAND which is unsafe.
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+--source include/stop_slave.inc
+RESET SLAVE;
+
# 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
@@ -36,6 +41,8 @@ start slave sql_thread;
SELECT COUNT(*) - 17920 as zero FROM t3;
--echo ==== Clean up ====
-stop slave sql_thread;
+--source include/stop_slave_sql.inc
--source include/cleanup_fake_relay_log.inc
drop table t1, t3;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_current_user-master.opt b/mysql-test/suite/rpl/t/rpl_current_user-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_current_user-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_current_user.cnf b/mysql-test/suite/rpl/t/rpl_current_user.cnf
index 999ee727a88..58b605ad928 100644
--- a/mysql-test/suite/rpl/t/rpl_current_user.cnf
+++ b/mysql-test/suite/rpl/t/rpl_current_user.cnf
@@ -1,9 +1,8 @@
!include ../my.cnf
[mysqld.3]
-server-id=3
-log-bin=slave-bin
+log-slave-updates
[ENV]
-SLAVE_MYPORT1= @mysqld.3.port
-SLAVE_MYSOCK1= @mysqld.3.socket
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/rpl/t/rpl_current_user.test b/mysql-test/suite/rpl/t/rpl_current_user.test
index 79816ef6c95..ac2af1af14e 100644
--- a/mysql-test/suite/rpl/t/rpl_current_user.test
+++ b/mysql-test/suite/rpl/t/rpl_current_user.test
@@ -10,35 +10,31 @@
# 'ALTER EVENT'.
#
##############################################################################
-source include/master-slave.inc;
+
source include/have_binlog_format_statement.inc;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
---echo
---echo # On slave2
-connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
-connection slave2;
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
---echo # Connect slave2 to slave
---replace_result $SLAVE_MYPORT SLAVE_MYPORT;
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT,
- MASTER_LOG_FILE='slave-bin.000001', MASTER_USER='root';
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--disable_query_log
+--connection server_1
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
+--connection server_2
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
+--connection server_3
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
+--enable_query_log
+
+--connection master
---echo
---echo # [On master]
-connection master;
---disable_warnings
-DROP VIEW IF EXISTS v_user;
-DROP VIEW IF EXISTS v_tables_priv;
-DROP VIEW IF EXISTS v_procs_priv;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS my_grant;
-DROP PROCEDURE IF EXISTS my_revoke;
-DROP FUNCTION IF EXISTS my_user;
-DROP EVENT IF EXISTS e1;
---enable_warnings
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
@@ -64,75 +60,76 @@ connection conn1;
--echo # [On conn1]
--echo # Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
-let $diff_table= test.v_user;
-let $diff_server_list= master, slave, slave2;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON TABLE ...' statement
-connection conn1;
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON PROCEDURE...' statement
-connection conn1;
GRANT ALTER ROUTINE, EXECUTE ON PROCEDURE p1 TO CURRENT_USER();
-let $diff_table= test.v_procs_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON *.* ...' statement
-connection conn1;
GRANT ALL PRIVILEGES ON *.* TO CURRENT_USER() WITH GRANT OPTION;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON TABLE ...' statement
-connection conn1;
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON PROCEDURE...' statement
-connection conn1;
REVOKE ALTER ROUTINE, EXECUTE ON PROCEDURE p1 FROM CURRENT_USER();
-let $diff_table= test.v_procs_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON *.* ...' statement
-connection conn1;
REVOKE ALL PRIVILEGES ON *.* FROM CURRENT_USER();
-let $diff_table= test.v_user;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ...' statement in the procedure
-connection conn1;
CREATE PROCEDURE my_grant()
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
call my_grant;
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON TABLE ...' statement in the procedure
-connection conn1;
CREATE PROCEDURE my_revoke()
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
call my_revoke;
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'RENAME USER ...' statement
-connection conn1;
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
-let $diff_table= test.v_user;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
disconnect conn1;
@@ -143,7 +140,9 @@ GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
connect (conn1, 127.0.0.1, 'bug48321_2'@'localhost',,);
connection conn1;
DROP USER CURRENT_USER();
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
--echo
--echo # Verify 'ALTER EVENT...' statement
@@ -152,16 +151,17 @@ CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
--echo # Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
-let $diff_table= test.v_event;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_event, server_2:v_event, server_3:v_event;
+source include/diff_tables.inc;
-connection master;
--echo
--echo # Session user will be set as definer, if the statement does not assign
--echo # a definer
ALTER EVENT e1 ENABLE;
-sync_slave_with_master;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_event, server_2:v_event, server_3:v_event;
+source include/diff_tables.inc;
--echo
--echo # Verify that this patch does not affect the calling of CURRENT_USER()
@@ -173,8 +173,8 @@ SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
---echo # [On slave2]
-sync_slave_with_master slave2;
+--echo # [On server_3]
+sync_slave_with_master server_3;
SELECT * FROM t1;
connection master;
@@ -184,8 +184,8 @@ SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
-sync_slave_with_master slave2;
---echo # [On slave2]
+sync_slave_with_master server_3;
+--echo # [On server_3]
SELECT * FROM t1;
connection master;
@@ -195,8 +195,8 @@ SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
-sync_slave_with_master slave2;
---echo # [On slave2]
+sync_slave_with_master server_3;
+--echo # [On server_3]
SELECT * FROM t1;
connection master;
@@ -219,8 +219,8 @@ sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
SELECT * FROM t2;
-sync_slave_with_master slave2;
---echo # [On slave2]
+sync_slave_with_master server_3;
+--echo # [On server_3]
SELECT * FROM t1;
SELECT * FROM t2;
@@ -234,6 +234,5 @@ DROP PROCEDURE my_grant;
DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;
-sync_slave_with_master;
-sync_slave_with_master slave2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test
index 80df16a7a00..83a530131a6 100644
--- a/mysql-test/suite/rpl/t/rpl_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_ddl.test
@@ -30,3 +30,4 @@ let $temp_engine_type= MEMORY;
let $show_binlog = 0;
let $manipulate = 0;
-- source extra/rpl_tests/rpl_ddl.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index ee907f81b22..b2d4e42a973 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
@@ -1,10 +1,3 @@
-################################
-# Wrapper for rpl_deadlock.test#
-################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=innodb;
diff --git a/mysql-test/suite/rpl/t/rpl_delete_no_where.test b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
index 64a293b4058..4bfe6d07b5a 100644
--- a/mysql-test/suite/rpl/t/rpl_delete_no_where.test
+++ b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
@@ -5,3 +5,4 @@
-- source include/master-slave.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_delete_no_where.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index f04ac54ac50..94dd1c5d3f4 100644
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
@@ -213,17 +213,19 @@ stop slave;
connection master;
# user was already dropped in the slave before
-# so no need to wait for the slave to replicate
-# this statement (if it did and we later synced
-# the slave it would end up in an error anyway)
+# so we should not replicate this statement.
+SET SQL_LOG_BIN= 0;
DROP USER 'create_rout_db'@'localhost';
+SET SQL_LOG_BIN= 1;
--enable_warnings
# finish entire clean up (remove binlogs)
# so that we leave a pristine environment for the
# following tests
--- source include/master-slave-reset.inc
+--let $rpl_only_running_threads= 1
+-- source include/rpl_reset.inc
+USE test;
# BUG#49119: Master crashes when executing 'REVOKE ... ON
# {PROCEDURE|FUNCTION} FROM ...'
@@ -248,7 +250,7 @@ DROP USER 'create_rout_db'@'localhost';
-- echo ######## BUG#49119 #######
-- echo ### i) test case from the 'how to repeat section'
--- source include/master-slave-reset.inc
+
-- connection master
CREATE TABLE t1(c1 INT);
@@ -269,7 +271,7 @@ DROP PROCEDURE p1;
-- echo ### ii) Test case in which REVOKE partially succeeds
-- connection master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
CREATE TABLE t1(c1 INT);
@@ -329,8 +331,7 @@ DROP USER 'user49119'@'localhost';
# Bug #51987 revoke privileges logs wrong error code
#
--- connection master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
grant all on *.* to foo@"1.2.3.4";
@@ -344,14 +345,29 @@ revoke all privileges, grant option from "foo";
## assertion: slave replicates revoke and does not fail because master
## logged revoke with correct expected error code
--- let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1)
- if ($err)
-{
- -- die UNEXPECTED ERROR AT SLAVE: $err
-}
+--source include/check_slave_no_error.inc
-- connection master
DROP USER foo@"1.2.3.4";
-- sync_slave_with_master
---echo "End of test"
+--echo
+--echo # Bug#27606 GRANT statement should be replicated with DEFINER information
+--source include/rpl_reset.inc
+--connection master
+GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
+
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+sync_slave_with_master;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+
+--connection master
+REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+sync_slave_with_master;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+
+--connection master
+DROP USER user_bug27606@localhost;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop.test b/mysql-test/suite/rpl/t/rpl_drop.test
index 7af325240ee..7b8873345b9 100644
--- a/mysql-test/suite/rpl/t/rpl_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_drop.test
@@ -1,13 +1,12 @@
# Testcase for BUG#4552 (DROP on two tables, one of which does not
# exist, must be binlogged with a non-zero error code)
source include/master-slave.inc;
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
+
create table t1 (a int);
--error 1051
drop table t1, t2;
-sync_slave_with_master;
+--sync_slave_with_master
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index 11e93e7307a..c3194f08f52 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -58,4 +58,5 @@ drop table t1;
drop database mysqltest1;
sync_slave_with_master;
-source include/stop_slave.inc;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_if_exists.test b/mysql-test/suite/rpl/t/rpl_drop_if_exists.test
deleted file mode 100644
index 6b2b37ae791..00000000000
--- a/mysql-test/suite/rpl/t/rpl_drop_if_exists.test
+++ /dev/null
@@ -1,115 +0,0 @@
-# BUG#13684:
-# SP: DROP PROCEDURE|FUNCTION IF EXISTS not binlogged if routine
-# does not exist
-#
-# There is an inconsistency with DROP DATABASE IF EXISTS, DROP
-# TABLE IF EXISTS and DROP VIEW IF EXISTS: those are binlogged even
-# if the DB or TABLE does not exist, whereas DROP PROCEDURE IF
-# EXISTS does not. It would be nice or at least consistent if DROP
-# PROCEDURE/STATEMENT worked the same too.
-#
-# Description:
-# DROP PROCEDURE|FUNCTION IF EXISTS does not get binlogged whereas DROP
-# DATABASE|TABLE|TRIGGER|... IF EXISTS do.
-#
-# Fixed DROP PROCEDURE|FUNCTION IF EXISTS by adding a call to
-# write_bin_log in mysql_execute_command. Checked also if all
-# documented "DROP (...) IF EXISTS" get binlogged. Left out DROP
-# SERVER IF EXISTS because it seems that it only gets binlogged when
-# using row event (see BUG#25705).
-#
-# TODO: add DROP SERVER IF EXISTS to the test case when its
-# binlogging procedure gets fixed (BUG#25705). Furthermore, when
-# logging in RBR format the events that get logged are effectively in
-# RBR format and not in STATEMENT format meaning that one must needs
-# to be extra careful when writing a test for it, or change the CREATE
-# SERVER logging to always log as STATEMENT. You can quickly check this
-# by enabling the flag below $fixed_bug_25705=1 and watch the diff on
-# the STDOUT. More detail may be found on the generated reject file.
-#
-# Test is implemented as follows:
-#
-# i) test each "drop if exists" (DDL), found in MySQL 5.1 manual,
-# on inexistent objects (except for DROP SERVER);
-# ii) show binlog events;
-# iii) create an object for each drop if exists statement;
-# iv) issue "drop if exists" in existent objects.
-# v) show binlog events;
-#
-# References:
-# http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-data-definition.html
-#
---source include/have_log_bin.inc
-RESET MASTER;
-
-disable_warnings;
-
-# test all "drop if exists" in manual with inexistent objects
-DROP PROCEDURE IF EXISTS db_bug_13684.p;
-DROP FUNCTION IF EXISTS db_bug_13684.f;
-DROP TRIGGER IF EXISTS db_bug_13684.tr;
-DROP VIEW IF EXISTS db_bug_13684.v;
-DROP EVENT IF EXISTS db_bug_13684.e;
-DROP TABLE IF EXISTS db_bug_13684.t;
-DROP DATABASE IF EXISTS db_bug_13684;
-
-let $fixed_bug_25705 = 0;
-
-if($fixed_bug_25705)
-{
- DROP SERVER IF EXISTS s_bug_13684;
-}
---source include/show_binlog_events.inc
-
-# test drop with existing values
-
-# create
-CREATE DATABASE db_bug_13684;
-
-CREATE TABLE db_bug_13684.t (a int);
-
-CREATE EVENT db_bug_13684.e
- ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
- DO
- UPDATE db_bug_13684.t SET a = a + 1;
-
-CREATE VIEW db_bug_13684.v
- AS SELECT * FROM db_bug_13684.t;
-
-CREATE TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
- FOR EACH ROW BEGIN
- END;
-
-CREATE PROCEDURE db_bug_13684.p (OUT p1 INT)
- BEGIN
- END;
-
-CREATE FUNCTION db_bug_13684.f (s CHAR(20))
- RETURNS CHAR(50) DETERMINISTIC
- RETURN s;
-
-if($fixed_bug_25705)
-{
- CREATE SERVER s_bug_13684
- FOREIGN DATA WRAPPER mysql
- OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
-}
-
---source include/show_binlog_events.inc
-
-# drop existing
-DROP PROCEDURE IF EXISTS db_bug_13684.p;
-DROP FUNCTION IF EXISTS db_bug_13684.f;
-DROP TRIGGER IF EXISTS db_bug_13684.tr;
-DROP VIEW IF EXISTS db_bug_13684.v;
-DROP EVENT IF EXISTS db_bug_13684.e;
-DROP TABLE IF EXISTS db_bug_13684.t;
-DROP DATABASE IF EXISTS db_bug_13684;
-if($fixed_bug_25705)
-{
- DROP SERVER IF EXISTS s_bug_13684;
-}
-
---source include/show_binlog_events.inc
-
-enable_warnings;
diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
index 7bc55c53447..641813070ca 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test
@@ -71,9 +71,8 @@ sync_slave_with_master;
# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW
#
--- connection master
--- source include/master-slave-reset.inc
--- connection master
+--source include/rpl_reset.inc
+--connection master
CREATE TABLE t1 ( i INT );
--sync_slave_with_master
@@ -95,3 +94,4 @@ SHOW STATUS LIKE 'Slave_open_temp_tables';
DROP TABLE t1;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-test/suite/rpl/t/rpl_drop_view.test
index 05bf112b8b8..55a0ea104d8 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_view.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_view.test
@@ -32,3 +32,4 @@ select * from v3;
connection master;
drop table t1, t2, t3;
sync_slave_with_master;
+--source include/rpl_end.inc
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 ab1de6a2e9f..618576f5641 100644
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
@@ -6,33 +6,21 @@
# of their server id).
# It also will test BUG#13861.
-source include/master-slave.inc;
source include/have_innodb.inc;
-
-# set up "dual head"
-
-# Needed for debug info in wait_for_slave_sql_to_stop.
-let $master_connection= slave;
-connection slave;
-reset master;
-
-connection master;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
-
-source include/start_slave.inc;
+--let $rpl_topology= 1->2->1
+--source include/rpl_init.inc
# now we test it
-connection slave;
+connection server_2;
create table t1 (n int);
let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1);
let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
let $master_log_pos_1= `SELECT $master_log_pos_1 + 3`;
-sync_slave_with_master master;
+--sync_slave_with_master server_1
#
# BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
@@ -42,7 +30,7 @@ source include/stop_slave.inc;
create table t2 (n int); # create one ignored event
-sync_slave_with_master;
+--sync_slave_with_master server_2
show tables;
@@ -59,7 +47,8 @@ insert into t3 values(3);
commit;
insert into t3 values(4);
-connection master;
+
+connection server_1;
# bug is that START SLAVE UNTIL may stop too late, we test that by
# asking it to stop before creation of t3.
@@ -89,26 +78,20 @@ source include/start_slave.inc;
# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
-connection master;
+connection server_1;
create table t4 (n int); # create 3 ignored events
create table t5 (n int);
create table t6 (n int);
-sync_slave_with_master;
-sync_slave_with_master master;
+--sync_slave_with_master server_2
# then BUG#13023 caused hang below ("master" looks behind, while it's
# not in terms of updates done).
+--sync_slave_with_master server_1
show tables;
# cleanup
-
-source include/stop_slave.inc;
-reset slave;
-drop table t1,t2,t3,t4,t5,t6;
-
-sync_slave_with_master;
-
-# End of 4.1 tests
+drop table t1, t2, t3, t4, t5, t6;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_host.test b/mysql-test/suite/rpl/t/rpl_empty_master_host.test
index 7d245b1d5d5..df0c85ad7ec 100644
--- a/mysql-test/suite/rpl/t/rpl_empty_master_host.test
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_host.test
@@ -49,3 +49,4 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
# start slave must succeed.
START SLAVE;
--source include/wait_for_slave_to_start.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
index 05cccdbae1d..9ebed299956 100644
--- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
@@ -64,3 +64,6 @@ DROP TABLE test.t4;
sync_slave_with_master;
# End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 45ef12862fc..1de5006f647 100644
--- a/mysql-test/suite/rpl/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -101,3 +101,4 @@ DROP EVENT event44331_2;
DROP EVENT event44331_3;
DROP EVENT event44331_4;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
deleted file mode 100644
index e9685baf01b..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
+++ /dev/null
@@ -1,13 +0,0 @@
-###########################################
-# Author: Jeb
-# Date: 2006-09-08
-# Purpose: Wapper for rpl_extraSlave_Col.test
-# Using innodb
-###########################################
--- source include/have_binlog_format_row.inc
--- source include/have_innodb.inc
--- source include/master-slave.inc
-let $engine_type = 'InnoDB';
--- source extra/rpl_tests/rpl_extraSlave_Col.test
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
deleted file mode 100644
index d56df394ccf..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
+++ /dev/null
@@ -1,12 +0,0 @@
-###########################################
-# Author: Jeb
-# Date: 2006-09-07
-# Purpose: Wapper for rpl_extraSlave_Col.test
-# Using MyISAM
-###########################################
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-let $engine_type = 'MyISAM';
--- source extra/rpl_tests/rpl_extraSlave_Col.test
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
index 29758366577..f48880b5dfa 100644
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
@@ -6,4 +6,6 @@
-- source include/have_innodb.inc
let $engine_type = 'InnoDB';
---source extra/rpl_tests/rpl_extraMaster_Col.test
+--source extra/rpl_tests/rpl_extra_col_master.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
index 31529a19cfc..4f344cfaca9 100644
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
@@ -5,4 +5,6 @@
-- source include/master-slave.inc
let $engine_type = 'MyISAM';
---source extra/rpl_tests/rpl_extraMaster_Col.test
+--source extra/rpl_tests/rpl_extra_col_master.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
new file mode 100644
index 00000000000..f4b04468273
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
@@ -0,0 +1,7 @@
+-- source include/have_binlog_format_row.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+
+let $engine_type = 'InnoDB';
+-- source extra/rpl_tests/rpl_extra_col_slave.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
new file mode 100644
index 00000000000..d8d64aed566
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
@@ -0,0 +1,6 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+let $engine_type = 'MyISAM';
+-- source extra/rpl_tests/rpl_extra_col_slave.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
deleted file mode 100644
index 3f82baff598..00000000000
--- a/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-lock-wait-timeout=1
diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
index 81e8342b5c0..798b3ef8b41 100644
--- a/mysql-test/suite/rpl/t/rpl_failed_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
@@ -1,10 +1,3 @@
-#######################################
-# Wrapper for rpl_failed_optimize.test#
-#######################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=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 aa2dee0fe57..13c66f9f64b 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
@@ -122,6 +122,8 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id
# if any of the above statement are not ignored, it would cause error
# and stop slave sql thread.
sync_slave_with_master;
+connection slave;
+call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146");
connection master;
# Parameters for include/wait_for_slave_sql_error_and_skip.inc:
@@ -204,4 +206,4 @@ SELECT * FROM t3;
connection master;
echo [on master];
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_flush_logs.test b/mysql-test/suite/rpl/t/rpl_flush_logs.test
index 5159acaae14..6e9de634157 100644
--- a/mysql-test/suite/rpl/t/rpl_flush_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_flush_logs.test
@@ -24,23 +24,16 @@ sync_slave_with_master;
--echo # Make sure relay logs was not be flushed
--echo # after execute 'flush error logs' statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
-
-
-# Test 'flush relay logs' statement.
---echo # Make sure the 'slave-relay-bin.000004' file does not
---echo # exist before execute 'flush relay logs' statement.
---error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
--echo # Test if support 'flush relay logs' statement.
flush relay logs;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000004' file is created
+--echo # Check the 'slave-relay-bin.000003' file is created
--echo # after executed 'flush relay logs' statement.
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
--echo # Make sure binary logs was not be flushed
@@ -96,10 +89,10 @@ file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001;
# Test 'flush error logs, relay logs' statement
sync_slave_with_master;
---echo # Make sure the 'slave-relay-bin.000007' file does not exist
+--echo # Make sure the 'slave-relay-bin.000006' file does not exist
--echo # exist before execute 'flush error logs, relay logs' statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
connection master;
@@ -114,19 +107,19 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000007' file is created after
+--echo # Check the 'slave-relay-bin.000006' file is created after
--echo # execute 'flush error logs, relay logs' statement.
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
# Test 'flush logs' statement
---echo # Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
---echo # files do not exist before execute 'flush error logs, relay logs'
+--echo # Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+--echo # files do not exist before execute 'flush error logs, relay logs'
--echo # statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
connection master;
@@ -140,8 +133,9 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
+--echo # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
--echo # files are created after execute 'flush logs' statement.
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009;
+--source include/rpl_end.inc
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 ad7fd508afe..3b5d41d4261 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 @@
---max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.1/data/relay-log
+--max_binlog_size=1M
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
deleted file mode 100644
index a321dd690cd..00000000000
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/slave-data/*-bin.*
-rm -f $MYSQLTEST_VARDIR/slave-data/master.info
-rm -f $MYSQLTEST_VARDIR/slave-data/*.index
-
-
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 c8d2f85bcb7..3b5d41d4261 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 @@
---max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.2/data/relay-log
+--max_binlog_size=1M
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
deleted file mode 100644
index e46ea6d400b..00000000000
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/master-data/master.info
-rm -f $MYSQLTEST_VARDIR/master-data/*-bin.*
-rm -f $MYSQLTEST_VARDIR/master-data/*.index
-
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index 76cd73ba9e0..d5d362bac0f 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -1,37 +1,12 @@
# Testing if "flush logs" command bouncing resulting in logs created in a loop
# in case of bi-directional replication
--- source include/master-slave.inc
-# Use wait_for_slave_to_(start|stop) for current connections
-let $keep_connection= 1;
+--let $rpl_topology= 1->2->1
+--source include/rpl_init.inc
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
show variables like 'relay_log%';
-connection slave;
---disable_warnings
-stop slave;
---source include/wait_for_slave_to_stop.inc
---enable_warnings
---replace_result $MASTER_MYPORT MASTER_PORT
-eval change master to master_host='127.0.0.1',master_user='root',
- master_password='',master_port=$MASTER_MYPORT;
-start slave;
---source include/wait_for_slave_to_start.inc
-#
-# Start replication slave -> master
-#
-connection master;
---disable_warnings
-stop slave;
---source include/wait_for_slave_to_stop.inc
---enable_warnings
---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;
-
-source include/start_slave.inc;
-
#
# Flush logs of slave
#
@@ -43,16 +18,16 @@ source include/start_slave.inc;
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
let $wait_binlog_event= CREATE TABLE t1;
--source include/wait_for_binlog_event.inc
-sync_slave_with_master;
+sync_slave_with_master server_2;
-connection master;
+connection server_1;
INSERT INTO t1 VALUE(1);
FLUSH LOGS;
-sync_slave_with_master;
+sync_slave_with_master server_2;
INSERT INTO t1 VALUE(2);
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
-sync_slave_with_master master;
+sync_slave_with_master server_1;
#
# Check that the master server's slave threads are still running and show
@@ -63,7 +38,9 @@ sync_slave_with_master master;
--source include/show_slave_status.inc
--disable_query_log
-connection master;
+connection server_1;
DROP TABLE t1;
-sync_slave_with_master;
+sync_slave_with_master server_2;
--enable_query_log
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
index d085bff2012..ce28c0334ec 100644
--- a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
@@ -1,10 +1,3 @@
-###################################
-# Wrapper for rpl_foreign_key.test#
-###################################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: FK not supported, skip test when NDB is forced
-####################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
diff --git a/mysql-test/suite/rpl/t/rpl_free_items.test b/mysql-test/suite/rpl/t/rpl_free_items.test
index 043e84160b8..581409cfc10 100644
--- a/mysql-test/suite/rpl/t/rpl_free_items.test
+++ b/mysql-test/suite/rpl/t/rpl_free_items.test
@@ -20,3 +20,4 @@ drop table t2;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_geometry.test b/mysql-test/suite/rpl/t/rpl_geometry.test
index eac98924b98..769c49c96b1 100644
--- a/mysql-test/suite/rpl/t/rpl_geometry.test
+++ b/mysql-test/suite/rpl/t/rpl_geometry.test
@@ -23,4 +23,4 @@ sync_slave_with_master;
connection master;
drop table t1, t2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_get_lock.test b/mysql-test/suite/rpl/t/rpl_get_lock.test
index b4ca57ce541..b5c08858055 100644
--- a/mysql-test/suite/rpl/t/rpl_get_lock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_lock.test
@@ -22,9 +22,7 @@ while ($1)
dec $1;
}
enable_query_log;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select get_lock("lock",3);
select * from t1;
# There is no point in testing REPLICATIION of the IS_*_LOCK
@@ -41,8 +39,9 @@ select is_free_lock("lock2");
select is_free_lock(NULL);
connection master1;
drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
+
+
+--source include/rpl_end.inc
# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
index 60765581faf..01247fefd64 100644
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
@@ -7,12 +7,6 @@
# So they can't be verified by test case here.
# Finish the following tests by calling its common test script:
# extra/rpl_tests/rpl_get_master_version_and_clock.test.
-# And meanwhile this test checks that the slave I/O thread refuses to start if slave
-# and master have the same server id (because this is a useless setup,
-# and otherwise SHOW SLAVE STATUS shows progress but all queries are
-# ignored, which has caught our customers), unless
-# --replicate-same-server-id.
-#
source include/master-slave.inc;
source include/have_debug.inc;
@@ -48,20 +42,6 @@ source extra/rpl_tests/rpl_get_master_version_and_clock.test;
eval set global debug= '$debug_saved';
-#Test case 3: This test checks that the slave I/O thread refuses to start
-#if slave and master have the same server id.
-connection slave;
-reset master;
-# replicate ourselves
-source include/stop_slave.inc;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_port=$SLAVE_MYPORT;
-start slave;
-
---echo *** must be having the replicate-same-server-id IO thread error ***
-let $slave_io_errno= 1593;
-let $show_slave_io_error= 1;
-source include/wait_for_slave_io_error.inc;
# cleanup
@@ -69,3 +49,4 @@ source include/wait_for_slave_io_error.inc;
SET DEBUG_SYNC= 'RESET';
# End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test
index 6fbdafc0f9c..1091e5aab0d 100644
--- a/mysql-test/suite/rpl/t/rpl_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_grant.test
@@ -36,3 +36,5 @@ sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat-master.opt b/mysql-test/suite/rpl/t/rpl_heartbeat-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test
index 59c3e10915e..92bf10eb741 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test
@@ -142,7 +142,7 @@ source include/check_slave_param.inc;
let $slave_wait_param_counter= 300;
let $slave_value= query_get_value("SHOW STATUS like 'Slave_received_heartbeats'", Value, 1);
# Checking the fact that at least one heartbeat is received
-while (`select $slave_value = 0`)
+while (!$slave_value)
{
dec $slave_wait_param_counter;
if (!$slave_wait_param_counter)
@@ -165,5 +165,6 @@ drop table t1;
sync_slave_with_master;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
+--source include/stop_slave.inc
--echo End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
index a3ed77c8bd2..f24de9ab8b8 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
@@ -1,17 +1,12 @@
!include ../my.cnf
[mysqld.1]
-server_id=1
+log-slave-updates
[mysqld.2]
-server_id=2
+log-slave-updates
[mysqld.3]
-server_id=3
[ENV]
-SLAVE_MYPORT1= @mysqld.3.port
-SLAVE_MYSOCK1= @mysqld.3.socket
-
-
-
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
index 81737feea9e..6bdd2bbee63 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
@@ -4,98 +4,91 @@
# Purpose: Testing heartbeat for schema
# 1 master and 2 slaves
#############################################################
---source include/master-slave.inc
---echo
+--let $rpl_topology= 1->2,1->3
+--source include/rpl_init.inc
---echo *** Preparing ***
---connection master
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
---connection slave
---echo [on slave]
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave_1
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave_2
+--let $rpl_server_number= 3
+--source include/rpl_connect.inc
+
+#
+# Set different heartbeat periods for slaves
+#
+--connection slave_1
--source include/stop_slave.inc
-RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT $binlog_file MASTER_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='$binlog_file';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
--source include/start_slave.inc
---disconnect slave1
---connect(slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,)
---connection slave1
---echo [on slave1]
---disable_warnings
-STOP SLAVE;
---enable_warnings
-RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT $binlog_file MASTER_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$binlog_file';
+--connection slave_2
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
--source include/start_slave.inc
---echo
#
-# Testing heartbeat
+# Testing heartbeat for one master and two slaves
#
# Check that heartbeat events sent to both slaves with correct periods
---echo *** 2 slaves ***
---connection slave
+--connection slave_1
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo Slave has received heartbeat event
---connection slave1
+--connection slave_2
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
-let $slave1_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
---echo Slave1 has received heartbeat event
---connection slave
-let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
-let $result= query_get_value(SELECT ($slave_rcvd_heartbeats DIV $slave1_rcvd_heartbeats) > 1 AS Result, Result, 1);
---echo Slave has received more heartbeats than Slave1 (1 means 'yes'): $result
+--let $assert_cond= [slave_1:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > [slave_2:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1]
+--let $assert_text= slave_1 should have received more heartbeats than slave_2
+--source include/assert.inc
--echo
+# Create topology master->slave_2->slave_1 and check that slave_1
+# receives heartbeat while slave_2 gets data.
+
+# slave_2 was started w/o --log-slave-updates because slave_2 should
+# not send data from master to slave_1
-# Create topology A->B->C and check that C receives heartbeat while B gets data
-# Slave1 (B) started w/o --log-slave-updates because B should not send data from A to C
---echo *** Master->data->Slave1->heartbeat->Slave: ***
---connection slave1
---echo [on slave1]
-RESET MASTER;
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
---connection slave
---echo [on slave]
+--source include/rpl_stop_slaves.inc
+--let $rpl_topology= 1->3->2
+--source include/rpl_change_topology.inc
+--source include/rpl_start_slaves.inc
+--connection slave_1
--source include/stop_slave.inc
-RESET SLAVE;
---replace_result $SLAVE_MYPORT1 SLAVE1_PORT $binlog_file SLAVE1_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT1, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.2, MASTER_LOG_FILE='$binlog_file';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
-# Check heartbeat for new replication channel slave1->slave
+
+# Check heartbeat for new replication channel slave_2->slave
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
---echo Slave has received heartbeat event
+--echo slave_1 has received heartbeat event
--connection master
--echo [on master]
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on master', '');
---save_master_pos
SHOW TABLES;
---connection slave1
---sync_with_master 0
---echo [on slave1]
+--echo [on slave_2]
+--sync_slave_with_master slave_2
SHOW TABLES;
-let $slave_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
---save_master_pos
---connection slave
---sync_with_master 0
---echo [on slave]
+let $slave_2_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+--echo [on slave_1]
+--sync_slave_with_master slave_1
SHOW TABLES;
--connection master
--echo [on master]
---echo creating updates on master and send to slave1 during 5 second
-# Generate events on master and send to slave1 during 5 second
+--echo creating updates on master and send to slave_2 during 5 second
+# Generate events on master and send to slave_2 during 5 second
let $i= 1;
let $j= 1;
let $k= 1;
@@ -103,17 +96,15 @@ let $k= 1;
while ($i) {
eval SET @c_text=REPEAT('1234567890', $j);
eval UPDATE t1 SET a=$j, c=@c_text;
- --connection slave1
- let $slave_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
- if (`SELECT ($k*($slave_pos - $slave_pos_before)) > 0`) {
- --connection slave
- let $slave_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+ --connection slave_2
+ let $slave_2_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+ if (`SELECT ($k*($slave_2_pos - $slave_2_pos_before)) > 0`) {
+ --connection slave_1
+ let $slave_1_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $k= 0;
let $time_before = `SELECT NOW()`;
}
if (`SELECT ((1-$k)*TIMESTAMPDIFF(SECOND,'$time_before',NOW())) > 5`) {
- --connection slave
- let $slave_rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $i= 0;
}
--connection master
@@ -121,10 +112,11 @@ while ($i) {
sleep 0.1;
}
--enable_query_log
---connection slave
---echo [on slave]
-let $result= query_get_value(SELECT ($slave_rcvd_heartbeats_after - $slave_rcvd_heartbeats_before) > 0 AS Result, Result, 1);
---echo Slave has received heartbeats (1 means 'yes'): $result
+--connection slave_1
+--echo [on slave_1]
+--let $assert_cond= [SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > $slave_1_rcvd_heartbeats_before
+--let $assert_text= slave_1 should have received heartbeats
+--source include/assert.inc
--echo
#
@@ -133,10 +125,5 @@ let $result= query_get_value(SELECT ($slave_rcvd_heartbeats_after - $slave_rcvd_
--echo *** Clean up ***
--connection master
DROP TABLE t1;
---save_master_pos
---connection slave1
---sync_with_master 0
---echo
-# End of 6.0 test
---echo End of 6.0 test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
index 1f8ce4c1d78..b9a170c5bc1 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
@@ -18,6 +18,9 @@
--source include/have_binlog_format_mixed.inc
--echo
+# Set number of retries to connect to master
+let $connect_retry= 20;
+
--echo *** Preparing ***
--connection slave
--source include/stop_slave.inc
@@ -57,7 +60,7 @@ RESET SLAVE;
SET @@global.slave_net_timeout=30;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5;
RESET SLAVE;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
--echo
@@ -68,7 +71,7 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=50;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
@@ -88,7 +91,7 @@ RESET SLAVE;
let $slave_net_timeout= query_get_value(SHOW VARIABLES LIKE 'slave_net_timeout', Value, 1);
inc $slave_net_timeout;
--replace_result $MASTER_MYPORT MASTER_PORT $slave_net_timeout SLAVE_NET_TIMEOUT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=$slave_net_timeout;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=$slave_net_timeout;
RESET SLAVE;
--echo
@@ -98,7 +101,7 @@ RESET SLAVE;
SET @@global.slave_net_timeout=20;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5;
SHOW VARIABLES LIKE 'slave_net_timeout';
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=2*@@global.slave_net_timeout;
@@ -118,9 +121,10 @@ SET @@global.slave_net_timeout=500;
SET @@global.slave_net_timeout=200;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry;
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
SHOW VARIABLES LIKE 'slave_net_timeout';
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
@@ -137,9 +141,10 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout;
SET @@global.slave_net_timeout=100;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=20;
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
--source include/stop_slave.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
@@ -152,18 +157,9 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=50;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-wait
-EOF
---echo Reload slave
---shutdown_server 10
---source include/wait_until_disconnected.inc
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=30;
+--let $rpl_server_number= 2
+--source include/rpl_restart_server.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
--echo
@@ -171,11 +167,12 @@ SET @restore_slave_net_timeout=@@global.slave_net_timeout;
# Disable heartbeat
--echo *** Disable heartbeat ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SHOW STATUS LIKE 'slave_received_heartbeats';
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
--sleep 2
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SHOW STATUS LIKE 'slave_received_heartbeats';
@@ -194,48 +191,48 @@ let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_hea
--echo *** Min slave_heartbeat_timeout ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.001;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.0009;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
RESET SLAVE;
--echo
--echo *** Max slave_heartbeat_timeout ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294967;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294968;
RESET SLAVE;
# Check double size of max allowed value for master_heartbeat_period
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=8589935;
RESET SLAVE;
# Check 2^32
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294967296;
RESET SLAVE;
--echo
--echo *** Misc incorrect values ***
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_PARSE_ERROR
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='-1';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_PARSE_ERROR
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='123abc';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_PARSE_ERROR
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='';
RESET SLAVE;
--echo
@@ -246,9 +243,10 @@ RESET SLAVE;
# Check received heartbeat events for running slave
--echo *** Running slave ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var= slave_received_heartbeats;
let $status_var_comparsion= >;
@@ -276,8 +274,7 @@ let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbea
# Check received heartbeat events for stopped IO thread
--echo *** Stopped IO thread ***
-STOP SLAVE IO_THREAD;
---source include/wait_for_slave_io_to_stop.inc
+--source include/stop_slave_io.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
sleep 2;
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -296,8 +293,7 @@ let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbea
# Check received heartbeat events for stopped SQL thread
--echo *** Stopped SQL thread ***
-STOP SLAVE SQL_THREAD;
---source include/wait_for_slave_sql_to_stop.inc
+--source include/stop_slave_sql.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
sleep 2;
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -323,6 +319,8 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL);
--connection master
INSERT INTO t1 VALUES (1, 'on master', NULL);
--connection slave
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
let $slave_errno= ER_DUP_ENTRY
--source include/wait_for_slave_sql_error.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -349,14 +347,13 @@ DELIMITER ;|
--connection slave
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5;
--source include/start_slave.inc
--connection master
# Enable scheduler
SET @@global.event_scheduler=1;
---connection slave
+--sync_slave_with_master
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
---sync_with_master
# Wait some updates for table t1 from master
let $wait_condition= SELECT COUNT(*)=1 FROM t1 WHERE a > 5;
--source include/wait_condition.inc
@@ -382,7 +379,7 @@ DROP TABLE t1;
RESET MASTER;
--connection slave
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.5;
let $slave_param_comparison= =;
--source include/start_slave.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -409,7 +406,7 @@ SET @@global.slave_compressed_protocol=1;
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var= slave_received_heartbeats;
@@ -428,7 +425,7 @@ SET @@global.slave_compressed_protocol=0;
STOP SLAVE;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--connection master
@@ -447,7 +444,7 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b
STOP SLAVE;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
# Wait until slave_received_heartbeats will be incremented
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -455,21 +452,11 @@ let $status_var= slave_received_heartbeats;
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo Heartbeat event received
---connection master
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
---echo Reload master
---shutdown_server 10
---source include/wait_until_disconnected.inc
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
---connection slave
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
# make sure IO thread has re-connected
# due to slow valgrind env the following wait_for_status may time out
+--let $rpl_allow_error= 1
--source include/wait_for_slave_io_to_start.inc
# Wait until slave_received_heartbeats will be incremented
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -482,13 +469,17 @@ let $status_var_comparsion= >;
# Circular replication: demonstrating bidirectional hearbeat flow
--echo *** Circular replication ***
# Configure circular replication
---source include/master-slave-reset.inc
---connection slave
+--source include/rpl_reset.inc
--source include/stop_slave.inc
-let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+--let $rpl_topology= 1->2->1
+--source include/rpl_change_topology.inc
+
+#--connection slave
+#--source include/stop_slave.inc
+#let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
--connection master
---replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
+#--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
+#eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
--source include/start_slave.inc
# Insert data on master and on slave and make sure that it replicated for both directions
@@ -501,9 +492,7 @@ CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
--sync_with_master
INSERT INTO t1 VALUES(2, 'on slave');
---save_master_pos
---connection master
---sync_with_master
+--sync_slave_with_master master
SELECT * FROM t1 ORDER BY a;
let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--connection slave
@@ -531,12 +520,10 @@ let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_hea
#
--echo *** Clean up ***
--connection master
---source include/stop_slave.inc
+#--source include/stop_slave.inc
DROP TABLE t1;
--sync_slave_with_master
---source include/stop_slave.inc
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
---echo
-# End of tests
---echo End of tests
+#--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
index 6460b157b52..810db4cc6f7 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
@@ -46,9 +46,11 @@ let $status_var_comparsion= >;
# Clean up
#
--echo *** Clean up ***
---connection master
---sync_slave_with_master
---echo
-
-# End of 6.0 test
---echo End of 6.0 test
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ MASTER_SSL=0,
+ MASTER_SSL_CA='',
+ MASTER_SSL_CERT='',
+ MASTER_SSL_KEY='';
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test
index a1931ce9b60..c229711e005 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test
@@ -4,9 +4,10 @@
source include/master-slave.inc;
# Add suppression for expected warning(s) in slaves error log
-call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
@@ -34,10 +35,7 @@ SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+--source include/check_slave_no_error.inc
# An insert of a row that already exists. Since we are replacing the
# row if it already exists, the most apropriate representation is
@@ -50,10 +48,7 @@ INSERT IGNORE INTO t1 VALUES (-2);
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+--source include/check_slave_no_error.inc
# BUG#19958: RBR idempotency issue for UPDATE and DELETE
@@ -78,13 +73,12 @@ SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+--source include/check_slave_no_error.inc
connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
index 2e6e2ce9a31..34074ba8ca9 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
@@ -57,3 +57,4 @@ delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_revoke.test b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
index 00171605a92..db20e807afc 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
@@ -49,3 +49,4 @@ sync_slave_with_master;
# Since changes to mysql.* are ignored, the revoke need to
# be done on slave as well
delete from mysql.user where user="user_foo";
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index 15c4b193669..233206c4135 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
@@ -127,6 +127,7 @@ show grants for mysqltest4@localhost;
# where mysqltest1 does not exist on slave,
# to succeed on slave the mode is temporarily changed
set global slave_exec_mode='IDEMPOTENT';
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032");
connection master;
drop table t1, mysqltest2.t2;
@@ -176,3 +177,6 @@ SELECT * FROM tmptbl504451f4258$1;
connection master;
DROP TABLE t5;
sync_slave_with_master;
+
+--source include/rpl_end.inc
+--source include/force_restart.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table_update.test b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
index fe030f90411..840052e2f25 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
@@ -36,3 +36,4 @@ sync_with_master;
drop table mysqltest_foo,mysqltest_bar,t1;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 08096d03c11..d6034009f4f 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -15,6 +15,7 @@ SELECT * FROM t1;
connection slave;
# Wait until SQL thread stops with error LOST_EVENT on master
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
let $slave_sql_errno= 1590;
let $show_slave_sql_error= 1;
source include/wait_for_slave_sql_error.inc;
@@ -37,3 +38,4 @@ source include/check_slave_is_running.inc;
connection master;
DROP TABLE t1;
--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 58d1f6bdc01..1803b146819 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
@@ -25,10 +25,10 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
connection master;
sync_slave_with_master;
-source include/stop_slave.inc;
# Restore changed global variable
set global init_connect= @my_global_init_connect;
set global max_connections= default;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
index 180821730ec..4dab13856d4 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
@@ -53,11 +53,12 @@ start slave;
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
-source include/wait_for_slave_to_stop.inc;
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
-let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
-echo Reporting the following error: $error;
-call mtr.add_suppression("Failed during slave I/O thread initialization");
+call mtr.add_suppression("Failed during slave.* thread initialization");
SET GLOBAL debug= "";
@@ -66,22 +67,23 @@ SET GLOBAL debug= "";
######################################################################
connection slave;
---disable_warnings
-stop slave;
---enable_warnings
-source include/wait_for_slave_to_stop.inc;
-
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
-source include/wait_for_slave_sql_to_stop.inc;
-
-let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
-echo Reporting the following error: $error;
+# 1064 = ER_PARSE_ERROR
+--let $slave_sql_errno= 1064
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
######################################################################
# Clean up
######################################################################
SET GLOBAL init_slave= "";
+
+# Clean up Last_SQL_Error
+--source include/stop_slave_io.inc
+RESET SLAVE;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
index a9cd6b15b6e..782c01ec04f 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
@@ -151,4 +151,4 @@ DROP TABLE test.regular_tbl;
DROP TABLE test.bykey_tbl;
DROP TABLE test.byrange_tbl;
---source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
index 4311328b064..9bfce61804b 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
@@ -62,5 +62,5 @@ connection master;
DROP PROCEDURE test.proc_norm;
DROP TABLE test.regular_tbl;
---source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test b/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
index 6eb9c7075e4..5147e67c160 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -8,7 +6,4 @@
--source include/have_binlog_format_mixed.inc
--source include/have_innodb.inc
let $engine_type= innodb;
-
--source suite/rpl/include/rpl_mixed_ddl.inc
-
-# End 5.1 Test Case
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test b/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
index d48e847a6c8..d04ced0f476 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -8,7 +6,4 @@
--source include/have_binlog_format_mixed.inc
--source include/have_innodb.inc
let $engine_type= innodb;
-
--source suite/rpl/include/rpl_mixed_dml.inc
-
-# End 5.1 Test Case
diff --git a/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test
index 6f916fb1f90..2a29139ac48 100644
--- a/mysql-test/suite/rpl/t/rpl_insert.test
+++ b/mysql-test/suite/rpl/t/rpl_insert.test
@@ -42,3 +42,4 @@ connection master;
USE test;
DROP SCHEMA mysqlslap;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_duplicate.test b/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
new file mode 100644
index 00000000000..7dd38a696ae
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
@@ -0,0 +1,14 @@
+#########################################
+# Wrapper for rpl_insert_duplicate.test #
+#########################################
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+#-- source include/have_binlog_format_mixed_or_statement.inc
+
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_insert_duplicate.test
+
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_insert_duplicate.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test
index 6daecce5843..f2f62a207a0 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id.test
@@ -1,12 +1,7 @@
#################################
# Wrapper for rpl_insert_id.test#
#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_insert_id.test
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
index 01f30b78ac5..c0d68855f85 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
@@ -1,10 +1,6 @@
#################################
# Wrapper for rpl_insert_id.test#
#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=innodb;
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
index 69be49634d0..0346975fcee 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
@@ -7,6 +7,10 @@
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-let $engine_type=innodb;
-let $engine_type2=myisam;
+-- let $engine_type=innodb
-- source extra/rpl_tests/rpl_insert_ignore.test
+
+-- let $engine_type=myisam
+-- source extra/rpl_tests/rpl_insert_ignore.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test
index 677be526982..23bc7ecd167 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_select.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_select.test
@@ -17,3 +17,4 @@ select * from t1;
connection master;
drop table t1,t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test
index 74ea8e12a98..7770c36c397 100644
--- a/mysql-test/suite/rpl/t/rpl_invoked_features.test
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test
@@ -308,3 +308,4 @@ DROP EVENT IF EXISTS e11;
--sync_slave_with_master slave
# End 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix-master.opt b/mysql-test/suite/rpl/t/rpl_ip_mix-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.test b/mysql-test/suite/rpl/t/rpl_ip_mix.test
index 0852b3f4ff7..c86e1ba54b7 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix.test
@@ -35,7 +35,6 @@ connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
connection master;
reset master;
source include/show_master_status.inc;
-save_master_pos;
--echo connection slave;
connection slave;
reset slave;
@@ -50,10 +49,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt b/mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.test b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
index 5d687006b76..3c928cffbc6 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
@@ -50,10 +50,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
index ecd5a754fdc..cacf5e187ef 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
@@ -66,10 +66,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv6.test
index 3eceedfd7a4..c42221445fb 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv6.test
@@ -52,10 +52,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
index 6957289b2d5..eff0392d5de 100644
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
@@ -122,7 +122,7 @@ echo [on master];
# This will block the execution of a statement at the DBUG_SYNC_POINT
# with given lock name
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
disable_query_log;
disable_result_log;
@@ -142,8 +142,8 @@ disable_warnings;
######## DATABASE ########
-let $diff_statement= SELECT schema_name FROM information_schema.schemata
- WHERE schema_name LIKE 'd%' ORDER BY schema_name;
+let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata
+ WHERE schema_name LIKE \'d%\' ORDER BY schema_name;
send CREATE DATABASE d2;
source include/kill_query_and_diff_master_slave.inc;
@@ -162,9 +162,9 @@ source include/kill_query_and_diff_master_slave.inc;
######## EVENT ########
-let $diff_statement= SELECT event_name, event_body, execute_at
- FROM information_schema.events where event_name like 'e%'
- ORDER BY event_name;
+let $rpl_diff_statement= SELECT event_name, event_body, execute_at
+ FROM information_schema.events where event_name like \'e%\'
+ ORDER BY event_name;
send CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
@@ -185,7 +185,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## FUNCTION ########
-let $diff_statement= SHOW FUNCTION STATUS LIKE 'f%';
+--let $rpl_diff_statement= SHOW FUNCTION STATUS LIKE \'f%\'
send CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
@@ -214,7 +214,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## PROCEDURE ########
-let $diff_statement= SHOW PROCEDURE STATUS LIKE 'p%';
+--let $rpl_diff_statement= SHOW PROCEDURE STATUS LIKE \'p%\'
DELIMITER //;
send CREATE PROCEDURE p2 (OUT rows INT)
@@ -237,7 +237,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## TABLE ########
-let $diff_statement= SHOW TABLES LIKE 't%';
+--let $rpl_diff_statement= SHOW TABLES LIKE \'t%\'
send CREATE TABLE t2 (b int);
source include/kill_query_and_diff_master_slave.inc;
@@ -250,7 +250,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## INDEX ########
-let $diff_statement= SHOW INDEX FROM t1;
+--let $rpl_diff_statement= SHOW INDEX FROM t1
send CREATE INDEX i2 on t1 (a);
source include/kill_query_and_diff_master_slave.inc;
@@ -263,7 +263,7 @@ source include/kill_query_and_diff_master_slave.inc;
# Tempoarily disabled, see bug#25705
-# let $diff_statement= SELECT * FROM mysql.server WHERE name like 's%';
+# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\'
# send CREATE SERVER s2
# FOREIGN DATA WRAPPER mysql
@@ -287,7 +287,7 @@ connection master;
CREATE TABLE IF NOT EXISTS t4 (a int);
connection master1;
-let $diff_statement= SHOW TRIGGERS LIKE 'v%';
+--let $rpl_diff_statement= SHOW TRIGGERS LIKE \'v%\'
DELIMITER //;
send CREATE TRIGGER tr2 BEFORE INSERT ON t4
@@ -306,7 +306,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## VIEW ########
-let $diff_statement= SHOW TABLES LIKE 'v%';
+--let $rpl_diff_statement= SHOW TABLES LIKE \'v%\'
send CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query_and_diff_master_slave.inc;
@@ -319,7 +319,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## DROP TABLE ########
-let $diff_statement= SHOW TABLES LIKE 't%';
+--let $rpl_diff_statement= SHOW TABLES LIKE \'t%\'
send DROP TABLE t1;
source include/kill_query_and_diff_master_slave.inc;
@@ -360,3 +360,4 @@ DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
enable_warnings;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
index b48698baa47..f4b854eff87 100644
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
@@ -25,11 +25,12 @@ connection master;
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
SELECT * FROM t1;
connection slave;
---source include/wait_for_slave_sql_to_stop.inc
+
# show the error message
#1105 = ER_UNKNOWN_ERROR
--let $slave_sql_errno= 1105
--let $show_slave_sql_error= 1
+call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
--source include/wait_for_slave_sql_error.inc
# show that it was not replicated
SELECT * FROM t1;
@@ -83,17 +84,25 @@ ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
SELECT * FROM t1;
connection slave;
---source include/wait_for_slave_sql_to_stop.inc
+
# show the error message
#1105 = ER_UNKNOWN_ERROR
--let $slave_sql_errno= 1105
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
+
# show that it was not replicated
SELECT * FROM t1;
connection master;
+
+# clean up
drop table t1, t2;
connection slave;
drop table t1, t2;
+# clear error message in sql thread
+--source include/stop_slave_io.inc
+RESET SLAVE;
# End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
deleted file mode 100644
index c015c02ba78..00000000000
--- a/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-wild-do-table=mysqltest.%
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test
index d5e0388be46..9f4ca1aaf18 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata.test
@@ -1,7 +1,3 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_binlog_format_statement.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
index 3e1bc917a41..bb87ee95913 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
@@ -46,3 +46,4 @@ source include/rpl_loaddata_charset.inc;
# LOAD DATA LOCAL INFILE
let $LOAD_LOCAL=0;
source include/rpl_loaddata_charset.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
index b8975308a86..be099c1b6c4 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
@@ -15,6 +15,7 @@ connection master;
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
connection slave;
+call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593");
let $slave_sql_errno= 1593;
let $show_slave_sql_error= 1;
source include/wait_for_slave_sql_error_and_skip.inc;
@@ -23,3 +24,4 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 48451c4aee1..1fe9283ef44 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
@@ -48,3 +48,4 @@ DROP TABLE test.t1;
sync_slave_with_master;
# End of test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
index 831680eb5ef..5fdeb855110 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
@@ -1 +1 @@
---read_buffer_size=12K --max_allowed_packet=8K
+--read_buffer_size=12K --max_allowed_packet=8K --net-buffer-length=8K
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
index 95f55bcf7d8..7d404fae240 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
@@ -1 +1 @@
---max_allowed_packet=8K
+--max_allowed_packet=8K --net-buffer-length=8K
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-test/suite/rpl/t/rpl_loaddata_map.test
index 1db7c4a893b..24c8221c20f 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test
@@ -71,3 +71,4 @@ connection master;
drop table t2;
sync_slave_with_master;
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
index 91ebcf058a6..2116796871a 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
@@ -24,3 +24,4 @@ source include/show_binlog_events.inc;
connection master;
drop table test.t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
index 439c2b48ca5..a09d3feec42 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
@@ -12,3 +12,4 @@ SELECT * FROM t1 ORDER BY word;
connection master;
drop table t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh
index 066f72926af..e5bb3e61d11 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh
@@ -1 +1,2 @@
+rm -f $MYSQLTEST_VARDIR/std_data_master_link
ln -s $MYSQLTEST_VARDIR/std_data $MYSQLTEST_VARDIR/std_data_master_link
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh
index 218209a2542..7a0c0bb382a 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh
@@ -1 +1,2 @@
+rm -f $MYSQLTEST_VARDIR/std_data_slave_link
ln -s $MYSQLTEST_VARDIR/std_data $MYSQLTEST_VARDIR/std_data_slave_link
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
index 69b481bddd1..c73fa2897f3 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
@@ -19,3 +19,4 @@ connection master;
drop table t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index ed556f3aedf..4ebe572741f 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -151,12 +151,34 @@ eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
--echo [slave]
sync_slave_with_master;
-# cleanup
+--echo
+--echo Bug #59267:
+--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
+--echo
---remove_file $MYSQLD_DATADIR/bug43746.sql
+--echo [master]
+connection master;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+
+SELECT 'Master', COUNT(*) FROM t1;
+
+--echo [slave]
+--sync_slave_with_master
+SELECT 'Slave', COUNT(*) FROM t1;
+
+# cleanup
--echo [master]
connection master;
+
+--remove_file $MYSQLD_DATADIR/bug43746.sql
+--remove_file $MYSQLD_DATADIR/bug59267.sql
+
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
@@ -164,3 +186,55 @@ SET SESSION sql_mode=@old_mode;
sync_slave_with_master;
connection master;
+
+--echo
+--echo Bug #60580/#11902767:
+--echo "statement improperly replicated crashes slave sql thread"
+--echo
+
+--echo [master]
+connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+
+CREATE TABLE t3 AS SELECT * FROM t2;
+
+CREATE VIEW v1 AS SELECT * FROM t2
+ WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+
+SELECT * FROM t1;
+
+sleep 1;
+
+--echo [slave]
+sync_slave_with_master;
+
+SELECT * FROM t1;
+
+--remove_file $MYSQLD_DATADIR/bug60580.csv
+
+--echo [master]
+connection master;
+
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+
+--echo [slave]
+sync_slave_with_master;
+
+connection master;
+--source include/rpl_end.inc
+
+--echo # End of 5.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index adb23d2c2bc..ced0054c52c 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -58,8 +58,7 @@
# vii) assert that the contents of master and slave
# table are the same
-connection master;
-source include/reset_master_and_slave.inc;
+--source include/rpl_reset.inc
connection master;
let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
@@ -105,11 +104,12 @@ sync_slave_with_master;
# if the file was removed before the slave started,
# meaning that contents were indeed transfered
# through binlog (in row format)
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
# CLEAN UP
+--connection master
DROP TABLE t1;
DROP PROCEDURE p;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_locale.test b/mysql-test/suite/rpl/t/rpl_locale.test
index 2f2d637e1b4..0d6692dd89c 100644
--- a/mysql-test/suite/rpl/t/rpl_locale.test
+++ b/mysql-test/suite/rpl/t/rpl_locale.test
@@ -22,3 +22,4 @@ sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index daf4b9093fe..44837e45715 100644
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -32,9 +32,7 @@ start slave;
let $slave_io_errno= 1236;
let $show_slave_io_error= 1;
source include/wait_for_slave_io_error.inc;
---disable_warnings
-source include/stop_slave.inc;
---enable_warnings
+source include/stop_slave_sql.inc;
connection master;
source include/show_master_status.inc;
@@ -54,3 +52,4 @@ drop table t1;
sync_slave_with_master;
--echo End of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
index ecdf10ac2c2..b0d3b23b4e1 100644
--- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
+++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
@@ -58,10 +58,10 @@ FLUSH LOGS;
# error to slave.
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
connection slave;
-source include/wait_for_slave_io_to_stop.inc;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-echo Last_IO_Error;
-echo $last_error;
+# 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
connection master;
@@ -103,4 +103,4 @@ SHOW TABLES;
connection master;
DROP TABLE t1, t2, t3, t4;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_many_optimize.test b/mysql-test/suite/rpl/t/rpl_many_optimize.test
index 91fab0b27a8..d5e9f69b4bc 100644
--- a/mysql-test/suite/rpl/t/rpl_many_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_many_optimize.test
@@ -20,3 +20,4 @@ drop table t1;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index ea107a28954..25e27f62d0a 100644
--- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
@@ -25,3 +25,5 @@ echo "*** must be NULL ***";
select master_pos_wait('foo', 98);
# End of 4.1 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test
index d7ecde5f53c..7189e5c44ba 100644
--- a/mysql-test/suite/rpl/t/rpl_misc_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test
@@ -124,3 +124,4 @@ DROP FUNCTION test_replication_sf;
--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
index 9b8346ef21b..ed932eb5cea 100644
--- a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
+++ b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
@@ -156,3 +156,4 @@ DROP PROCEDURE log_me_inner;
DROP FUNCTION log_rows;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test
index 2c44829a649..a310fa254f7 100644
--- a/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test
@@ -3,3 +3,4 @@
--source include/not_embedded.inc
--source include/not_windows.inc
--source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt
deleted file mode 100644
index 45631525481..00000000000
--- a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
index 1d407f87dfa..3850a84cbf1 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
@@ -5,3 +5,4 @@
--source include/have_binlog_format_mixed.inc
--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test b/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
index c9b65d170ad..226a82dee97 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
@@ -80,3 +80,4 @@ sync_slave_with_master;
connection master;
DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
index 333697e27e9..c5b821ca906 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
@@ -47,3 +47,4 @@ drop table t2,t3,t5;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
index 8c635202ad5..f37ce90e524 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
@@ -8,3 +8,4 @@
--source include/have_innodb.inc
--source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
index 1a32c388921..161ab2f9dca 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
@@ -8,3 +8,4 @@
--let $engine=Innodb
set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
index 8bb5b61210b..0893f7d0158 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
@@ -8,3 +8,4 @@
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_delete.test b/mysql-test/suite/rpl/t/rpl_multi_delete.test
index 568a8a578a9..80acf9c80e4 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_delete.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete.test
@@ -22,3 +22,4 @@ drop table t1,t2;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_delete2.test b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
index c3f939276e0..7dc7ca41405 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_delete2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
@@ -64,3 +64,4 @@ drop database mysqltest_to;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index 31c4a2050d7..b1dbf99f114 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
@@ -102,3 +102,4 @@ DROP TABLE t1;
sync_slave_with_master;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test
index a6111455d16..710337816da 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update.test
@@ -1,7 +1,3 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_multi_update.test
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test
index 812a486ad69..497568f2738 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test
@@ -8,3 +8,4 @@
--source include/master-slave.inc
let $engine_type=MyISAM;
--source extra/rpl_tests/rpl_multi_update2.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test
index 5da91c26b04..f6e70f14b30 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update3.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test
@@ -8,3 +8,4 @@
--source include/master-slave.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_multi_update3.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update4.test b/mysql-test/suite/rpl/t/rpl_multi_update4.test
index 4991a385f6f..8f069b9c18f 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update4.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update4.test
@@ -43,3 +43,4 @@ drop database d2;
sync_slave_with_master;
# End of test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
index 8797da4eccc..fedad86ea91 100644
--- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
+++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
@@ -30,7 +30,7 @@ sync_slave_with_master;
connection master;
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
-if (`SELECT '$before_position'='$after_position'`)
+if ($before_position == $after_position)
{
echo Master position is not changed;
}
@@ -48,7 +48,7 @@ connection master;
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
-if (!`SELECT '$before_position'='$after_position'`)
+if ($before_position != $after_position)
{
echo Master position has been changed;
}
@@ -56,3 +56,5 @@ if (!`SELECT '$before_position'='$after_position'`)
DROP DATABASE `mysqltest-1`;
connection slave;
DROP DATABASE `#mysql50#mysqltest-1`;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_name_const.test b/mysql-test/suite/rpl/t/rpl_name_const.test
index d3ef557ddc0..4cacafa0523 100644
--- a/mysql-test/suite/rpl/t/rpl_name_const.test
+++ b/mysql-test/suite/rpl/t/rpl_name_const.test
@@ -45,4 +45,4 @@ select * from t1 order by id;
connection master;
drop table t1;
drop procedure test_procedure;
---sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
index 2f2db01f422..94dbc56d73b 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
@@ -11,3 +11,4 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
index 614519331e0..53d8fec9434 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
@@ -13,3 +13,4 @@ let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
--diff_files suite/rpl/r/rpl_non_direct_row_mixing_engines.result suite/rpl/r/rpl_row_mixing_engines.result
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
index 448719eb4f8..13d4c998fb4 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
@@ -11,3 +11,4 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test b/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
index f8e697d58ce..a174445f667 100644
--- a/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
@@ -50,8 +50,9 @@ INSERT INTO t1 VALUES (RAND());
INSERT INTO t1 VALUES (LAST_INSERT_ID());
--sync_slave_with_master
---let $diff_table_1= master:test.t1
---let $diff_table_2= slave:test.t1
+--let $diff_tables= master:t1, slave:t1
--source include/diff_tables.inc
+--connection master
DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
index dca0ea6589c..1e67ba4eda1 100644
--- a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
@@ -17,3 +17,4 @@
let $engine=Innodb;
--source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
index 0c036f5bfd7..dcfaf006dad 100644
--- a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
@@ -16,3 +16,4 @@
let $engine=MyISAM;
--source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test
index 77d045e70fe..b48ef579b6b 100644
--- a/mysql-test/suite/rpl/t/rpl_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_optimize.test
@@ -63,3 +63,4 @@ sync_slave_with_master;
# starts, this test will demonstrate nothing but will pass.
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 38b868cb59d..7e9a35883a3 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -26,8 +26,8 @@ let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
+sync_slave_with_master;
# Restart slave for setting to take effect
-connection slave;
source include/stop_slave.inc;
source include/start_slave.inc;
@@ -84,17 +84,21 @@ 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
-let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
---echo Slave_IO_Running = $slave_io_running (expect No)
+
#
# Bug#42914: The slave I/O thread must stop after trying to read the above
# event, However there is no Last_IO_Error report.
#
-let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-eval SELECT "$last_io_error" AS Last_IO_Error;
+
+# The slave I/O thread must stop after trying to read the above event
+connection slave;
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# TODO: this is needed because of BUG#55790. Remove once that is fixed.
+--source include/stop_slave_sql.inc
#
# Bug#42914: On the master, if a binary log event is larger than
@@ -102,7 +106,14 @@ eval SELECT "$last_io_error" AS Last_IO_Error;
# is sent to a slave when it requests a dump from the master, thus leading the
# I/O thread to stop. However, there is no Last_IO_Error reported.
#
-source include/master-slave-reset.inc;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
connection master;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
sync_slave_with_master;
@@ -112,12 +123,10 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R
connection slave;
# The slave I/O thread must stop after receiving
-# ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
---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)
-let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-eval SELECT "$last_io_error" AS Last_IO_Error;
+# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
# Remove the bad binlog and clear error status on slave.
STOP SLAVE;
@@ -160,4 +169,8 @@ eval SET @@global.net_buffer_length= $old_net_buffer_length;
connection slave;
DROP TABLE t1;
+# Clear Last_IO_Error
+RESET SLAVE;
+
+--source include/rpl_end.inc
# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_plugin_load.test b/mysql-test/suite/rpl/t/rpl_plugin_load.test
index 100683922ad..5f9725a8e66 100644
--- a/mysql-test/suite/rpl/t/rpl_plugin_load.test
+++ b/mysql-test/suite/rpl/t/rpl_plugin_load.test
@@ -56,5 +56,5 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
sync_slave_with_master;
#
# Cleanup
---source include/master-slave-end.inc
+--source include/rpl_end.inc
--echo End of test
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index 143f75e5477..b3d07dd1400 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -66,73 +66,36 @@ source include/wait_for_slave_to_stop.inc;
###############################################################################
---echo
--echo # Connection: slave
---echo
--connection slave
---echo
START SLAVE;
---echo
--echo # Connection: master
---echo
--connection master
---echo
CREATE DATABASE mysqltest1;
CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32));
---echo
PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)';
---echo
EXECUTE stmt_d_1;
---echo
use mysqltest1;
---echo
EXECUTE stmt_d_1;
---echo
---sync_slave_with_master
-
-
---echo
--echo # Connection: slave
---echo
+--sync_slave_with_master
---echo
SELECT * FROM t1;
---echo
--echo # Connection: master
---echo
--connection master
---echo
DROP DATABASE mysqltest1;
---echo
use test;
DROP TABLE t1;
---echo
---sync_slave_with_master
-
-
---echo
---echo # Connection: slave
---echo
-
---echo
-STOP SLAVE;
-
---echo
---echo ########################################################################
-
-###############################################################################
-reset master;
-reset slave;
-disconnect master;
+--source include/rpl_end.inc
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 4dca3e0880c..30cc564917a 100644
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -31,3 +31,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test
index 040ae71586b..fb92803847a 100644
--- a/mysql-test/suite/rpl/t/rpl_read_only.test
+++ b/mysql-test/suite/rpl/t/rpl_read_only.test
@@ -41,30 +41,39 @@ set global read_only=0;
connection master1;
BEGIN;
+
+connection master2;
+BEGIN;
+
+connection master;
+select @@read_only;
+set global read_only=1;
+
+connection master1;
+-- echo *** On SUPER USER connection ***
insert into t1 values(1002);
--disable_warnings
insert into t2 values(2002);
--enable_warnings
connection master2;
-BEGIN;
+-- echo *** On regular USER connection ***
+--error ER_OPTION_PREVENTS_STATEMENT
insert into t1 values(1003);
---disable_warnings
+--error ER_OPTION_PREVENTS_STATEMENT
insert into t2 values(2003);
---enable_warnings
-
-connection master;
-set global read_only=1;
connection master1;
## works even with read_only=1, because master1 is root
+-- echo *** SUPER USER COMMIT (must succeed) ***
COMMIT;
connection master2;
---error ER_OPTION_PREVENTS_STATEMENT
+-- echo *** regular USER COMMIT (must succeed - nothing to commit) ***
COMMIT;
connection master;
+select @@read_only;
set global read_only=0;
connection master1;
@@ -117,3 +126,4 @@ sync_slave_with_master;
set global read_only=0;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
index 156d53ef856..ca16a583fe5 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
@@ -1,22 +1,4 @@
-###################################
-# Wrapper rpl_sv_relay_space.test #
-# This test has to be wrapped as #
-# It tests ndb, innodb and MyISAM.#
-# By Wrapping we are saving some #
-# space and making the test more #
-# Maintainable by only having one #
-# test file and reusing the code #
-# In Addition, INNODB has to have #
-# Option files during this test #
-# to force innodb on the slave #
-# else the test will fail #
-###################################
-#Change Author: JBM #
-#Change Date: 2006-02-03 #
-#Change: Added Comments #
-###################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_sv_relay_space.test
-
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
index 1d8563e7fd9..13719cbdc33 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
@@ -1,21 +1,3 @@
-###################################
-# Wrapper rpl_sv_relay_space.test #
-# This test has to be wrapped as #
-# It tests ndb, innodb and MyISAM.#
-# By Wrapping we are saving some #
-# space and making the test more #
-# Maintainable by only having one #
-# test file and reusing the code #
-# In Addition, INNODB has to have #
-# Option files during this test #
-# to force innodb on the slave #
-# else the test will fail #
-###################################
-#Change Author: JBM #
-#Change Date: 2006-02-03 #
-#Change: Added Comments #
-###################################
-- source include/not_ndb_default.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_sv_relay_space.test
-
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test
index 248389d793d..f187fbc033f 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -12,3 +12,4 @@
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_relayrotate.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
index cd04c2ccc0b..fc33d6bc0ba 100644
--- a/mysql-test/suite/rpl/t/rpl_relayspace.test
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test
@@ -2,10 +2,9 @@
# to force the deadlock after one event.
source include/master-slave.inc;
-let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1);
+--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1)
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
connection master;
# This will generate a master's binlog > 10 bytes
create table t1 (a int);
@@ -21,22 +20,33 @@ let $slave_param_value= Waiting for the slave SQL thread to free enough relay lo
source include/wait_for_slave_param.inc;
# A bug caused the I/O thread to refuse stopping.
-stop slave io_thread;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
reset slave;
-start slave;
-# The I/O thread stops filling the relay log when
-# it's >10b. And the SQL thread cannot purge this relay log
-# as purge is done only when the SQL thread switches to another
-# relay log, which does not exist here.
-# So we should have a deadlock.
-# if it is not resolved automatically we'll detect
-# it with master_pos_wait that waits for farther than 1Ob;
-# it will timeout;
-# also the slave will probably not cooperate to shutdown
-# (as 2 threads are locked)
---replace_result $master_log_file MASTER_LOG_FILE
-eval select master_pos_wait('$master_log_file',200,30)=-1;
+--source include/start_slave.inc
+# The I/O thread stops filling the relay log when it's >10b. And the
+# SQL thread cannot purge this relay log as purge is done only when
+# the SQL thread switches to another relay log, which does not exist
+# here. So we should have a deadlock. If it is not resolved
+# automatically we'll detect it with master_pos_wait that waits for
+# farther than 1Ob; it will timeout after 300 seconds (which is inline
+# with the default used for sync_slave_with_master and will protect us
+# against slow test envs); also the slave will probably not cooperate
+# to shutdown (as 2 threads are locked)
+--let $outcome= `SELECT MASTER_POS_WAIT('$master_log_file',200,300) AS mpw;`
+
+# master_pos_wait returns:
+#
+# * >= 0, the number of events the slave had to wait to advance to the
+# position
+#
+# * -1, if there was a timeout
+#
+# * NULL, if an error occurred, or the SQL thread was not started,
+# slave master info is not initialized, the arguments are incorrect
+--let $assert_text= Assert that master_pos_wait does not timeout nor it returns NULL
+--let $assert_cond= $outcome IS NOT NULL AND $outcome <> -1
+--source include/assert.inc
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
index dd3ecc075cc..e9a7eef9676 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
@@ -84,3 +84,4 @@ connection master;
drop table t1;
drop table t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
index bcfef919fad..f1907456ed5 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
@@ -28,3 +28,4 @@ connection master;
drop database mysqltest1;
drop database mysqltest2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_report.test b/mysql-test/suite/rpl/t/rpl_report.test
index 8798905d372..a73442917fa 100644
--- a/mysql-test/suite/rpl/t/rpl_report.test
+++ b/mysql-test/suite/rpl/t/rpl_report.test
@@ -19,3 +19,4 @@ set @@global.report_host='my.new.address.net';
--echo end of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 585b08be0b3..996ad0a10c7 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
@@ -237,3 +237,4 @@ connection master;
sync_slave_with_master;
# end of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
deleted file mode 100644
index 80190bf6d29..00000000000
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---server-id=2
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
deleted file mode 100644
index 81490a54b4b..00000000000
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/slave-data/master.info
-rm -f $MYSQLTEST_VARDIR/slave-data/*relay*
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index ca83020bff0..6e2a7e22352 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -18,19 +18,14 @@
-- source include/have_binlog_format_mixed_or_statement.inc
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
---disable_warnings
-drop table if exists t1, t2, t3, t4;
---enable_warnings
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
+
# Create empty file
let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
write_file $MYSQLD_SLAVE_DATADIR/master.info;
EOF
chmod 0000 $MYSQLD_SLAVE_DATADIR/master.info;
connection slave;
---disable_warnings
-drop table if exists t1, t2, t3, t4;
---enable_warnings
# START SLAVE will fail because it can't read the file (mode 000)
# (system error 13)
@@ -98,12 +93,10 @@ connection master;
set insert_id=1234;
insert into t2 values(NULL);
connection slave;
---source include/wait_for_slave_sql_to_stop.inc
-
-#restart slave skipping one event
-set global sql_slave_skip_counter=1;
-start slave;
---source include/wait_for_slave_to_start.inc
+# 1062 = ER_DUP_ENTRY
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062");
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error_and_skip.inc
connection master;
@@ -194,3 +187,4 @@ show binlog events in '';
purge master logs before now();
--echo End of 5.0 tests
+--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test
index f949e0b2d5f..96521280afd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_001.test
@@ -10,3 +10,4 @@
let $engine_type=MYISAM;
-- source extra/rpl_tests/rpl_row_001.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_4_bytes.test b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
index 73ef6dd2345..6130f74983e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
@@ -31,3 +31,4 @@ select * from t2 order by a;
connection master;
DROP DATABASE mysqltest1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_NOW.test b/mysql-test/suite/rpl/t/rpl_row_NOW.test
index c28b714277e..d732c6e6733 100644
--- a/mysql-test/suite/rpl/t/rpl_row_NOW.test
+++ b/mysql-test/suite/rpl/t/rpl_row_NOW.test
@@ -72,3 +72,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.
sync_slave_with_master;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test
index 7b13ebc50ee..010e0e6ea05 100644
--- a/mysql-test/suite/rpl/t/rpl_row_USER.test
+++ b/mysql-test/suite/rpl/t/rpl_row_USER.test
@@ -58,3 +58,4 @@ DROP USER ''@'localhost%';
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test
index b0ef96463d0..ce3a4ed40a9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_UUID.test
+++ b/mysql-test/suite/rpl/t/rpl_row_UUID.test
@@ -7,3 +7,4 @@
-- source include/master-slave.inc
let $engine_type=myisam;
--source extra/rpl_tests/rpl_row_UUID.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
index f6c690aa590..8cd021e88fc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
@@ -35,13 +35,15 @@ USE test_ignore;
connection master;
DROP DATABASE test_ignore;
+USE test;
+DROP TABLE t1;
sync_slave_with_master;
+USE test;
+
# Bug#19995: Extreneous table maps generated for statements that does
# not generate rows
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT);
@@ -57,13 +59,12 @@ DROP TABLE t1;
# BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
# slave
--echo ================ Test for BUG#17620 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
+--source include/rpl_reset.inc
--echo **** On Slave ****
connection slave;
SET GLOBAL QUERY_CACHE_SIZE=0;
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032");
--echo **** On Master ****
connection master;
@@ -91,12 +92,13 @@ sync_slave_with_master;
SELECT * FROM t1;
SET GLOBAL QUERY_CACHE_SIZE=0;
+--connection master
+DROP TABLE t1;
+
# Bug#22550: Replication of BIT columns failing
--echo ================ Test for BUG#22550 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
@@ -122,9 +124,7 @@ sync_slave_with_master;
# field does not work
--echo ================ Test for BUG#22583 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
+--source include/rpl_reset.inc
# disabling warnings temporarily for ENGINE=INNODB to work without InnoDB
--disable_warnings
@@ -229,13 +229,10 @@ sync_slave_with_master;
# row-based replication
#
-disable_query_log;
-source include/master-slave-reset.inc;
-enable_query_log;
+--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
-SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave'));
INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
--echo **** On Slave ****
@@ -243,7 +240,7 @@ sync_slave_with_master;
UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
# since bug#31552/31609 idempotency is not default any longer. In
-# order the preceeding test UPDATE t1 to pass the mode is switched
+# order for the preceeding test UPDATE t1 to pass, the mode is switched
# temprorarily
set @@global.slave_exec_mode= 'IDEMPOTENT';
--echo **** On Master ****
@@ -257,9 +254,10 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
+
SELECT * FROM t1 ORDER BY a;
-DROP TABLE t1;
--echo **** On Master ****
connection master;
DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
index c5648fa1d77..f1f5c584543 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
@@ -4,3 +4,4 @@
let $type= 'MYISAM' ;
let $extra_index= ;
-- source extra/rpl_tests/rpl_row_basic.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
index 41cf1cc622a..55ea2f3c3c8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
@@ -8,3 +8,4 @@ let $type= 'INNODB' ;
let $extra_index= ;
-- source extra/rpl_tests/rpl_row_basic.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
index 687b3bc785d..3ec79ec8cd5 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
@@ -208,3 +208,4 @@ SHOW CREATE TABLE t1;
DROP TABLE IF EXISTS t1;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt
deleted file mode 100644
index eb56e5c0a09..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680 --default-storage-engine=MyISAM
diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
index 5133c8b1b5e..9c8489658f8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
@@ -5,3 +5,4 @@
--source include/have_binlog_format_row.inc
--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
index 6aa6c2a31b9..eaf86688a29 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
@@ -12,3 +12,4 @@
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_row_blob.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
index 11f5336502a..482ccb7ecc0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
@@ -11,3 +11,4 @@
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_blob.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-test/suite/rpl/t/rpl_row_colSize.test
index 078e6886ec7..0701c44edd3 100644
--- a/mysql-test/suite/rpl/t/rpl_row_colSize.test
+++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test
@@ -160,9 +160,14 @@ let $test_table_slave = CREATE TABLE t1 (a TINYBLOB);
let $test_insert = INSERT INTO t1 VALUES ('This is a test.');
source include/test_fieldsize.inc;
+connection slave;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677");
+
--echo *** Cleanup ***
connection master;
DROP TABLE IF EXISTS t1;
sync_slave_with_master;
# END 5.1 Test Case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
index 59757e2e802..ce5332966ef 100644
--- a/mysql-test/suite/rpl/t/rpl_row_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
@@ -20,6 +20,8 @@ SET @old_slave_exec_mode= @@global.slave_exec_mode;
SET @@global.slave_exec_mode = 'STRICT';
source extra/rpl_tests/rpl_conflicts.test;
+--source include/rpl_reset.inc
+
--echo ######## Run with slave_exec_mode=IDEMPOTENT ########
@@ -28,4 +30,4 @@ source extra/rpl_tests/rpl_conflicts.test;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
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 6b051fb46e5..ef3c0758643 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -12,12 +12,6 @@ connection master;
# we disable the ps-protocol for this statement.
--disable_ps_protocol
---disable_query_log
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
---enable_query_log
-
# Set the default storage engine to different values on master and
# slave. We need to stop the slave for the server variable to take
# effect, since the variable is only read on start-up.
@@ -31,7 +25,7 @@ START SLAVE;
--source include/wait_for_slave_to_start.inc
--enable_query_log
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT, b INT);
@@ -67,7 +61,7 @@ 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
+--source include/rpl_reset.inc
connection master;
# Test for erroneous constructions
@@ -86,7 +80,7 @@ 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
+--source include/rpl_reset.inc
connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
@@ -99,7 +93,7 @@ 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
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t8 LIKE t4;
@@ -131,7 +125,7 @@ START SLAVE;
# table' from log):
--echo ================ BUG#22864 ================
---source include/master-slave-reset.inc
+--source include/rpl_reset.inc
connection master;
SET AUTOCOMMIT=0;
@@ -168,17 +162,7 @@ SET AUTOCOMMIT=1;
sync_slave_with_master;
# Some tests with temporary tables
-connection slave;
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
-RESET SLAVE;
-
-connection master;
-RESET MASTER;
-
-connection slave;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT);
@@ -204,7 +188,7 @@ connection master;
TRUNCATE TABLE t2;
sync_slave_with_master;
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
BEGIN;
@@ -253,7 +237,7 @@ sync_slave_with_master;
# BUG#34707: Row based replication: slave creates table within wrong database
#
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
connection master;
--disable_warnings
@@ -275,7 +259,7 @@ sync_slave_with_master;
# <tmp_tbl> with RBL
#
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
connection master;
CREATE TEMPORARY TABLE t7(c1 INT);
@@ -305,5 +289,7 @@ DROP VIEW IF EXISTS bug48506_t1, bug48506_t2, bug48506_t3;
DROP TEMPORARY TABLES t7;
DROP TABLES t4, t5;
DROP TABLES IF EXISTS bug48506_t4;
-source include/master-slave-end.inc;
+
+--source include/rpl_end.inc
+
--echo end of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
index a0e74567349..db41ff09117 100644
--- a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
+++ b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
@@ -1,7 +1,3 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_delayed_ins.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test
index d18ebc2846b..eca2ae0f643 100644
--- a/mysql-test/suite/rpl/t/rpl_row_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop.test
@@ -43,3 +43,4 @@ DROP TABLE IF EXISTS t2;
sync_slave_with_master;
--enable_warnings
--enable_query_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
index fc46665ddb1..5896f6a48b0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
@@ -8,3 +8,4 @@
--source include/have_innodb.inc
--source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_find_row.test b/mysql-test/suite/rpl/t/rpl_row_find_row.test
index 9163ab54406..7f633c5aa97 100644
--- a/mysql-test/suite/rpl/t/rpl_row_find_row.test
+++ b/mysql-test/suite/rpl/t/rpl_row_find_row.test
@@ -50,7 +50,7 @@ DROP TABLE t;
# but it gets disabled sometime.
# Replication does not break anymore.
#
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
CREATE TABLE t (a int, b int, c int, key(b));
@@ -84,8 +84,7 @@ DROP TABLE t;
# As a consquence, the wrong row would be updated.
#
--- connection master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2));
@@ -94,11 +93,11 @@ INSERT INTO t1(c1,c2) VALUES(1,2);
UPDATE t1 SET c1=1000 WHERE c2=2;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
index eebe8059d5c..1d33962ad48 100644
--- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
@@ -14,4 +14,3 @@ let $rename_event_pos= 926;
--disable_ps_protocol
-- source extra/rpl_tests/rpl_flsh_tbls.test
--enable_ps_protocol
-
diff --git a/mysql-test/suite/rpl/t/rpl_row_func001.test b/mysql-test/suite/rpl/t/rpl_row_func001.test
index 53fb55118e6..6ff97388b31 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func001.test
@@ -55,3 +55,4 @@ DROP TABLE test.t1;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_func002.test b/mysql-test/suite/rpl/t/rpl_row_func002.test
index 44a704bfbc5..2f4e3fdd910 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func002.test
@@ -102,3 +102,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/func002_master.sql $MYSQLTEST_VARDIR/tmp/func00
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003.test b/mysql-test/suite/rpl/t/rpl_row_func003.test
index 30b24cf4174..a17d70e4b04 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func003.test
@@ -11,3 +11,4 @@
-- source include/master-slave.inc
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_func003.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test
index cd62280f1d4..7f48d6503c1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test
@@ -9,10 +9,10 @@ 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 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
-
+call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
# bug#31609 Not all RBR slave errors reported as errors
# bug#31552 Replication breaks when deleting rows from out-of-sync table
@@ -326,6 +326,5 @@ drop table t1,t2,ti2,ti1;
sync_slave_with_master;
set @@global.slave_exec_mode= @old_slave_exec_mode;
---source include/master-slave-end.inc
-
--echo *** end of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
index 8b54878a203..cfad4fca433 100644
--- a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
@@ -8,3 +8,4 @@
--let $engine=Innodb
set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_end.inc
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 0c038c41ebf..22fd65ecaf3 100644
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -29,14 +29,17 @@ INSERT INTO t1 VALUES (1);
--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:
-let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
---echo Last_SQL_Error = $err
+# 1146 = ER_NO_SUCH_TABLE
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146");
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
--echo ==== Clean up ====
-source include/stop_slave.inc;
+source include/stop_slave_io.inc;
+RESET SLAVE;
--echo [on master]
connection master;
DROP TABLE t1;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
index 436c0a9f517..a6c38117767 100644
--- a/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
@@ -3,3 +3,4 @@
--source include/not_embedded.inc
--source include/not_windows.inc
--source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test
index 197f83c85af..b156a4c8dd4 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log.test
@@ -15,3 +15,4 @@
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_log.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
index 16e775287b3..631fb29c7bc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
@@ -12,3 +12,4 @@
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_log.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
index 8af1ae51bb9..f2e26f36fdc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
@@ -9,3 +9,4 @@
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index 3b829e7db7b..169d100fef4 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -352,3 +352,4 @@ DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
index 67e4c4fb14d..57d67c5c71b 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
@@ -8,3 +8,4 @@
-- let $engine= InnoDB
-- source extra/rpl_tests/rpl_record_compare.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
index 43fa99a51da..f96603f69ed 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
@@ -1,18 +1,17 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
+-- let $engine= MyISAM
#
# BUG#52868 Wrong handling of NULL value during update, replication out of sync
#
--- let $engine= MyISAM
--- source extra/rpl_tests/rpl_record_compare.test
-- echo ## coverage purposes - Field_bits
-- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
## Added here because AFAIK it's only MyISAM and NDB that use Field_bits
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=$engine DEFAULT CHARSET=latin1
@@ -22,10 +21,13 @@ INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
UPDATE t1 SET c1= 0;
-- sync_slave_with_master
--- let $diff_table_1= master:test.t1
--- let $diff_table_2= slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
+
+-- source extra/rpl_tests/rpl_record_compare.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
index 6a426efc7ea..a78f7ad4271 100644
--- a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
+++ b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
@@ -16,3 +16,4 @@
-- source include/have_binlog_format_row.inc
-- source extra/rpl_tests/rpl_show_relaylog_events.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test
index 34d42d985f9..99db5e7febe 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp001.test
@@ -142,3 +142,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_sl
--remove_file $MYSQLTEST_VARDIR/tmp/sp001_slave.sql
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
index e272e34e715..aec421407c9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
@@ -1,10 +1,3 @@
-#################################
-# Wrapper for rpl_row_sp002.test#
-#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test
index ab49174ddfa..bd085610725 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
@@ -14,3 +14,4 @@
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_sp003.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index abc7fb4f490..bbe4ce47f9e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
@@ -109,3 +109,4 @@ DROP TABLE IF EXISTS test.t3;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
index e5be4e6dc28..df3952bead1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
@@ -11,3 +11,4 @@
-- source include/master-slave.inc
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_row_sp006.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
index 41af5a5f997..fcac31df780 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
@@ -1,10 +1,3 @@
-#################################
-# Wrapper for rpl_row_sp007.test#
-#################################
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-# Added to skip if ndb is default #
-########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test
index 80603c28d27..8af3c88ae11 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp008.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp008.test
@@ -53,3 +53,4 @@ DROP TABLE IF EXISTS test.t2;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test
index 77860621961..6e7226593a1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp009.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp009.test
@@ -97,3 +97,4 @@ DROP TABLE test.t2;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp010.test b/mysql-test/suite/rpl/t/rpl_row_sp010.test
index 7fa0077f117..aad7edcd3ea 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp010.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp010.test
@@ -74,3 +74,4 @@ DROP TABLE IF EXISTS test.t2;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp011.test b/mysql-test/suite/rpl/t/rpl_row_sp011.test
index 25c2fc9ad26..d2a323faad2 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp011.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp011.test
@@ -109,3 +109,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/sp011_master.sql $MYSQLTEST_VARDIR/tmp/sp011_sl
--remove_file $MYSQLTEST_VARDIR/tmp/sp011_slave.sql
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test
index 3a8d295121c..23bc92b51cf 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp012.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test
@@ -73,3 +73,4 @@ sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
index ab4914e15fa..030ec7d6541 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
@@ -6,3 +6,4 @@ let $engine_type = 'MyISAM';
-- source extra/rpl_tests/rpl_row_tabledefs.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
index 7824fbfb663..35eddfc3ed4 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
@@ -7,3 +7,4 @@ let $engine_type = 'InnoDB';
-- source extra/rpl_tests/rpl_row_tabledefs.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
index d854aa64dc5..e8ac74f0125 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
@@ -193,8 +193,7 @@ FLUSH LOGS;
-- connection master
-- echo ### assertion: the slave replicated event successfully and tables match
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
DROP TABLE `t1`;
@@ -229,7 +228,7 @@ DROP TABLE `t1`;
# in both cases: when slave is replaying events and when
# mysqlbinlog is used to read the binary log
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
# Create several tables with field_metadata_size ranging
@@ -313,8 +312,7 @@ FLUSH LOGS;
while($ntables)
{
-- echo ### assertion: the slave replicated event successfully and tables match for t$ntables
- -- let $diff_table_1=master:test.t$ntables
- -- let $diff_table_2=slave:test.t$ntables
+ -- let $diff_tables= master:t$ntables, slave:t$ntables
-- source include/diff_tables.inc
-- connection master
@@ -337,4 +335,4 @@ while($ntables)
## For debugging purposes you might want not to remove these
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
-- remove_file $generated_sql
--- source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig001.test b/mysql-test/suite/rpl/t/rpl_row_trig001.test
index 8669034713a..39f2662b569 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig001.test
@@ -113,3 +113,4 @@ sync_slave_with_master;
diff_files $MYSQLTEST_VARDIR/tmp/trig001_master.sql $MYSQLTEST_VARDIR/tmp/trig001_slave.sql;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test
index 1ea245498d5..46f9ad91a3d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig002.test
@@ -72,3 +72,4 @@ DROP TABLE test.t3;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test
index 1ec568bf243..e332fc9174e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test
@@ -152,3 +152,4 @@ sync_slave_with_master;
diff_files $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test
index a918c602d56..fa5f973c355 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig004.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig004.test
@@ -16,3 +16,4 @@
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_trig004.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
index 60e1cd73200..394bf949f72 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
@@ -32,4 +32,4 @@ SELECT * FROM t2;
DROP TABLE t1;
connection master;
DROP TABLE t2;
---source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
index 069700546ce..9e6485d6630 100644
--- a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
@@ -33,3 +33,4 @@ connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
connection master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index bcd8ba8612b..b861bb8c8ec 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -4,39 +4,36 @@
# Note: The test is dependent on binlog positions
-# prepare version for substitutions
-let $VERSION=`select version()`;
-
# Create some events on master
connection master;
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4);
-# Save master log postion for query DROP TABLE t1
+# Save master log position for query DROP TABLE t1
let $master_pos_drop_t1= query_get_value(SHOW MASTER STATUS, Position, 1);
DROP TABLE t1;
-# Save master log postion for query DROP TABLE t1
+# Save master log position for query DROP TABLE t1
save_master_pos;
let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7);
let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7);
-# Save master log postion for query CREATE TABLE t2
+# Save master log position for query CREATE TABLE t2
let $master_pos_create_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
#show binlog events;
INSERT INTO t2 VALUES (1),(2);
-# Save master log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save master log position for query INSERT INTO t2 VALUES (1),(2);
let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
#show binlog events;
-# Save relay log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save relay log position for query INSERT INTO t2 VALUES (1),(2);
let $relay_pos_insert1_t2= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
connection master;
INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
-# Save master log postion for query DROP TABLE t2;
+# Save master log position for query DROP TABLE t2;
let $master_pos_drop_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
#show binlog events;
@@ -125,3 +122,10 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
START SLAVE;
--replace_result 740 MASTER_LOG_POS
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;
+
+--source include/stop_slave.inc
+# Clear slave IO error.
+RESET SLAVE;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_utf16.test b/mysql-test/suite/rpl/t/rpl_row_utf16.test
index b8f7b724ea1..e3e7a51c002 100644
--- a/mysql-test/suite/rpl/t/rpl_row_utf16.test
+++ b/mysql-test/suite/rpl/t/rpl_row_utf16.test
@@ -19,8 +19,10 @@ INSERT INTO t1 VALUES (); # default value is inserted and encoded correctl
--query_vertical SELECT c1, hex(c1) FROM t1
# assertion: tables don't differ
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
+--connection master
DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_utf32.test b/mysql-test/suite/rpl/t/rpl_row_utf32.test
index 44ca4b345c0..936d62b09bd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_utf32.test
+++ b/mysql-test/suite/rpl/t/rpl_row_utf32.test
@@ -42,3 +42,4 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
-- source include/stop_slave.inc
-- source include/start_slave.inc
-- connection master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test
index 77e4b98f780..cc60ab9912c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_view01.test
+++ b/mysql-test/suite/rpl/t/rpl_row_view01.test
@@ -95,3 +95,4 @@ sync_slave_with_master;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_wide_table.test b/mysql-test/suite/rpl/t/rpl_row_wide_table.test
index 7b17d7c4866..b1d16133096 100644
--- a/mysql-test/suite/rpl/t/rpl_row_wide_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_wide_table.test
@@ -337,3 +337,4 @@ sync_slave_with_master;
# END of Test Case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_savepoint.test b/mysql-test/suite/rpl/t/rpl_savepoint.test
index 7fe8a0da651..2aacd1fa81e 100644
--- a/mysql-test/suite/rpl/t/rpl_savepoint.test
+++ b/mysql-test/suite/rpl/t/rpl_savepoint.test
@@ -44,4 +44,5 @@ FLUSH LOGS;
--echo # Connection master
connection master;
DROP TABLE nt;
---source include/master-slave-end.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 17fa67e97e3..f697fedfad4 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
enable_query_log;
connection master;
@@ -58,7 +59,7 @@ echo [ on master ];
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
@@ -123,7 +124,7 @@ echo [ on slave ];
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
@@ -609,6 +610,7 @@ UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
connection slave;
+change master to master_user='root',master_password='';
source include/start_slave.inc;
connection master;
@@ -618,3 +620,4 @@ sync_slave_with_master;
connection master;
drop user rpl@127.0.0.1;
flush privileges;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
index 78be60a4852..4cfb5d53923 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
@@ -1 +1 @@
---max-connections=23
+--max-connections=40
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
index 3b68441141a..c84f597c1ee 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
@@ -15,12 +15,13 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
enable_query_log;
connection master;
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
@@ -34,7 +35,7 @@ source include/stop_slave.inc;
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
@@ -107,3 +108,4 @@ DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_server_id.test b/mysql-test/suite/rpl/t/rpl_server_id.test
deleted file mode 100644
index 6e98ec6ee6d..00000000000
--- a/mysql-test/suite/rpl/t/rpl_server_id.test
+++ /dev/null
@@ -1,29 +0,0 @@
-# Test for BUG#28908 Replication: set global server_id is not setting the session server_id
-
--- source include/have_log_bin.inc
-
-let $saved_server_id=`select @@server_id`;
-set global server_id=1;
-reset master;
-
--- disable_warnings
-drop table if exists t1,t2,t3;
--- enable_warnings
-
-create table t1 (a int);
-select @@server_id;
-source include/show_binlog_events2.inc;
-
-set global server_id=2;
-create table t2 (b int);
-select @@server_id;
-source include/show_binlog_events2.inc;
-
-set global server_id=3;
-create table t3 (c int);
-select @@server_id;
-source include/show_binlog_events2.inc;
-
-# cleanup
-eval set global server_id=$saved_server_id;
-drop table t1,t2,t3;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
index c97f7975278..90198a4ac5e 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id1.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
@@ -4,21 +4,19 @@
# ignored, which has caught our customers), unless
# --replicate-same-server-id.
-source include/master-slave.inc;
-connection slave;
-reset master;
+--let $rpl_topology= 2->2
+--let $rpl_skip_start_slave= 1
+--source include/rpl_init.inc
-# replicate ourselves
-source include/stop_slave.inc;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_port=$SLAVE_MYPORT;
-start slave;
+--connection server_2
+START SLAVE;
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_io_errno= 1593
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
-let $slave_param= Last_IO_Errno;
-let $slave_param_value= 1593;
-source include/wait_for_slave_param.inc;
---echo *** must be having the replicate-same-server-id IO thread error ***
-let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
-let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1);
-echo Slave_IO_Errno= $last_io_errno;
-echo Slave_IO_Error= $last_io_error;
+--source include/stop_slave_sql.inc
+RESET SLAVE;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
index 5c51a7fc08e..21e197866cf 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id2.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
@@ -50,7 +50,7 @@ eval start slave until master_log_file='master-bin.000001', master_log_pos=$unti
--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 ***
+--echo *** checking until position execution: must be only t1 in the list ***
show tables;
# cleanup
@@ -64,3 +64,4 @@ drop table t2;
sync_slave_with_master;
# End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
index 1b38bd34d3d..004f4daa19d 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
@@ -112,3 +112,4 @@ sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_session_var.test b/mysql-test/suite/rpl/t/rpl_session_var.test
index 55e58674c61..cf3faa6578c 100644
--- a/mysql-test/suite/rpl/t/rpl_session_var.test
+++ b/mysql-test/suite/rpl/t/rpl_session_var.test
@@ -57,5 +57,5 @@ sync_slave_with_master;
SELECT length(data) < 100 FROM t1;
connection master;
drop table t1;
-sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test
index 241c1c5738b..296e5dfb079 100644
--- a/mysql-test/suite/rpl/t/rpl_set_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_set_charset.test
@@ -29,3 +29,4 @@ drop database mysqltest1;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_null_innodb.test b/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
index dba79b78fa1..2d0c34e1d0a 100644
--- a/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
@@ -4,3 +4,4 @@
-- let $engine= InnoDB
-- source extra/rpl_tests/rpl_set_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_null_myisam.test b/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
index 7b433071553..13cd7c3e4a8 100644
--- a/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
@@ -3,3 +3,4 @@
-- let $engine= MyISAM
-- source extra/rpl_tests/rpl_set_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sf.test b/mysql-test/suite/rpl/t/rpl_sf.test
deleted file mode 100644
index 4d12f3839a2..00000000000
--- a/mysql-test/suite/rpl/t/rpl_sf.test
+++ /dev/null
@@ -1,187 +0,0 @@
--- source include/have_log_bin.inc
-
-# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
-# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
-
-# save status
-
-let $oblf=`select @@SESSION.BINLOG_FORMAT`;
-let $otfc=`select @@log_bin_trust_function_creators`;
-
-set global log_bin_trust_function_creators=0;
-
-
-
-# fail *on definition*
-
-set binlog_format=STATEMENT;
-
-delimiter |;
---error ER_BINLOG_UNSAFE_ROUTINE
-create function fn16456()
- returns int
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# force in definition, so we can see whether we fail on call
-
-set global log_bin_trust_function_creators=1;
-
-delimiter |;
-create function fn16456()
- returns int
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-set global log_bin_trust_function_creators=0;
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# fail funcall in SBR
-
-set binlog_format=STATEMENT;
-
---error ER_BINLOG_UNSAFE_ROUTINE
-select fn16456();
-
-
-
-# clean
-
-drop function fn16456;
-
-
-
-# success in definition with deterministic
-
-set global log_bin_trust_function_creators=0;
-
-delimiter |;
-create function fn16456()
- returns int deterministic
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# allow funcall in SBR
-
-set binlog_format=STATEMENT;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# clean
-
-drop function fn16456;
-
-
-# success in definition with NO SQL
-
-set global log_bin_trust_function_creators=0;
-
-delimiter |;
-create function fn16456()
- returns int no sql
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# allow funcall in SBR
-
-set binlog_format=STATEMENT;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-# clean
-
-drop function fn16456;
-
-
-
-# success in definition with reads sql data
-
-set global log_bin_trust_function_creators=0;
-
-delimiter |;
-create function fn16456()
- returns int reads sql data
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# allow funcall in SBR
-
-set binlog_format=STATEMENT;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# clean
-
-drop function fn16456;
-
-
-
-# restore status
-
---disable_query_log
-eval set binlog_format=$oblf;
-eval set global log_bin_trust_function_creators=$otfc;
---enable_query_log
diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
index 9f202487968..105f1873659 100644
--- a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
@@ -23,14 +23,13 @@ connection master;
let $show_statement= SHOW SLAVE HOSTS;
let $field= Server_id;
# 3 is server_id of slave2.
-let $connection= ='3';
+let $condition= ='3';
source include/wait_show_condition.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT
SHOW SLAVE HOSTS;
connection slave2;
-STOP SLAVE IO_THREAD;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
connection master;
let $show_statement= SHOW SLAVE HOSTS;
@@ -44,4 +43,4 @@ source include/wait_show_condition.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT
SHOW SLAVE HOSTS;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_running.test b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
index 8578f1e5275..d8c86a2aeb1 100644
--- a/mysql-test/suite/rpl/t/rpl_show_slave_running.test
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
@@ -80,3 +80,4 @@ connection slave;
eval set global debug= '$debug_saved';
SET DEBUG_SYNC= 'RESET';
--echo End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
index 8d176ac0c3b..82d6e61a2cd 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_error.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
@@ -102,6 +102,8 @@ SET SQL_LOG_BIN=1;
connection slave;
+call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062");
+
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
@@ -167,3 +169,4 @@ DROP TABLE t1;
DROP TABLE t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
index 1a0ff8d52f0..4fdc1268b80 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -62,7 +62,10 @@ SELECT * FROM t2 ORDER BY a;
SELECT * FROM t3 ORDER BY a;
--connection slave
---source include/wait_for_slave_sql_to_stop.inc
+# 1146 = ER_NO_SUCH_TABLE
+call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146");
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
SHOW TABLES LIKE 't%';
if (`SELECT @@BINLOG_FORMAT = 'ROW'`) {
--replace_regex /AA/AA_for_row_or_XX_for_stmt_mixed/
@@ -77,7 +80,7 @@ if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
SELECT * FROM t2 ORDER BY a;
}
---source include/stop_slave.inc
+--source include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
--source include/start_slave.inc
@@ -107,7 +110,9 @@ 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
+# 1146 = ER_NO_SUCH_TABLE
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
--connection master
SELECT * FROM t1 ORDER BY a;
@@ -119,7 +124,7 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
---source include/stop_slave.inc
+--source include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
--source include/start_slave.inc
@@ -151,7 +156,9 @@ INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
COMMIT;
--connection slave
---source include/wait_for_slave_sql_to_stop.inc
+# 1146 = ER_NO_SUCH_TABLE
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
--connection master
SELECT * FROM t1 ORDER BY a;
@@ -163,7 +170,7 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-source include/stop_slave.inc;
+source include/stop_slave_io.inc;
RENAME TABLE t3_bak TO t3;
source include/start_slave.inc;
@@ -174,3 +181,4 @@ DROP TABLE t1,t2,t3;
--sync_slave_with_master
# End of 5.1 test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_in.test b/mysql-test/suite/rpl/t/rpl_slave_load_in.test
index 54ebdffce69..80a27479ae2 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_in.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_in.test
@@ -31,12 +31,10 @@ commit;
##########################################################################
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
##########################################################################
@@ -48,3 +46,4 @@ drop table t1;
drop table t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
deleted file mode 100644
index 51e410f911f..00000000000
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,remove_slave_load_file_before_write
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
index 1cf88deb56f..36327e2354a 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
@@ -1,22 +1,37 @@
-##########################################################################
+# ==== Purpose ====
+#
# This test verifies if the slave fails gracefully when the temporary
-# file used to load data is removed while it is about to be used it.
+# file used to load data is removed while it is about to be used.
# Similar errors are caught if the temporary directory is removed.
#
+# ==== Implementation ====
+#
# Steps:
+# 0 - Set debug variable remove_slave_load_file_before_write. This
+# causes the slave to remove the file.
# 1 - Creates a table and populates it through "LOAD DATA INFILE".
# 2 - Catches error.
-##########################################################################
+#
+# ==== References ====
+#
+# BUG#42861: Assigning invalid directories to --slave-load-tmpdir crashes the slave
+# BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/master-slave.inc
--source include/not_embedded.inc
+--source include/not_var_link.inc
##########################################################################
# Loading data
##########################################################################
+
+connection slave;
+--let $old_debug= `SELECT @@GLOBAL.DEBUG`
+SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write';
+
connection master;
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
@@ -31,19 +46,14 @@ commit;
# Catch Error
##########################################################################
connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1)
# windows and linux different error numbers here:
# Windows:
# - Last_Errno 29 (File not found)
# Unix like OS:
# - Last_Errno 13 (Can't stat file)
---let $assertion= `SELECT $error=29 OR $error=13`
-if (!$assertion)
-{
- --echo UNEXPECTED ERROR NUMBER: $error
-}
+--let $slave_sql_errno= 29, 13
+--source include/wait_for_slave_sql_error.inc
##########################################################################
# Clean up
@@ -52,9 +62,19 @@ connection master;
drop table t1;
-connection slave;
+--source include/sync_slave_io_with_master.inc
+--source include/stop_slave_io.inc
+RESET SLAVE;
drop table t1;
call mtr.add_suppression("Slave: Can't get stat of .*");
+call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13");
call mtr.add_suppression("Slave: File.* not found.*");
+call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29");
+--let $rpl_only_running_threads= 1
+
+eval SET @@GLOBAL.DEBUG = '$old_debug';
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
index 68c41abf537..b99c71b1ca0 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
@@ -5,20 +5,18 @@
--source include/have_log_bin.inc
--source include/not_embedded.inc
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+--let $rpl_skip_start_slave= 1
+--source include/master-slave.inc
-connection slave;
-
---replace_result $MASTER_MYPORT MASTER_MYPORT
-eval CHANGE MASTER TO MASTER_USER='root',
- MASTER_CONNECT_RETRY=1,
- MASTER_HOST='127.0.0.1',
- MASTER_PORT=$MASTER_MYPORT;
+--connection slave
START SLAVE;
+# Why 12???
+call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12");
+--let $slave_sql_errno= 12
+source include/wait_for_slave_sql_error.inc;
+
+--source include/stop_slave_io.inc
+RESET SLAVE;
-source include/wait_for_slave_sql_to_stop.inc;
-let $errno=query_get_value("show slave status", Last_SQL_Errno, 1);
-echo $errno;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 66762d4dad0..f2129bd7f18 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -309,3 +309,4 @@ connection master;
DROP TABLE t10;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index 02fd555d13c..0645b4267d6 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -56,15 +56,23 @@ START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
source include/wait_for_slave_io_to_stop.inc;
---echo ==== Verify that Slave_IO_Running = No ====
-let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
---echo Slave_IO_Running = $result (should be No)
+--echo ==== Verify that Slave IO thread stopped with error ====
+# 1045 = ER_ACCESS_DENIED_ERROR
+--let $slave_io_errno= 1045
+--source include/wait_for_slave_io_error.inc
--echo ==== Cleanup (Note that slave IO thread is not running) ====
-DROP TABLE t1;
-# cleanup: slave io thread has been stopped "irrecoverably"
-# so we clean up mess manually
+
+# cleanup: slave io thread has is stopped so we reset replication
+--source include/stop_slave_sql.inc
+CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
+# clear Slave_IO_Errno
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
--echo [on master]
connection master;
DROP TABLE t1;
+
+--source include/rpl_end.inc
+--source include/force_restart.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
index 334c4393b83..faf037a9dff 100644
--- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
@@ -29,7 +29,7 @@ source include/master-slave.inc;
source include/have_binlog_format_statement.inc;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
# Prepare slave for different long_query_time we need to stop the slave
# and restart it as long_query_time variable is dynamic and, after
@@ -196,7 +196,7 @@ disconnect extra2;
# BUG#50620: Adding an index to a table prevents slave from logging into slow log
#
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
SET @old_log_output= @@log_output;
@@ -233,7 +233,7 @@ let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text
-- sync_slave_with_master
let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
-if (`SELECT $master_slow_query != $slave_slow_query`)
+if ($master_slow_query != $slave_slow_query)
{
-- connection master
-- echo ***********************************************
@@ -250,7 +250,7 @@ if (`SELECT $master_slow_query != $slave_slow_query`)
-- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
}
-if (`SELECT $master_slow_query = $slave_slow_query`)
+if ($master_slow_query == $slave_slow_query)
{
-- echo ### Assertion is good. Both Master and Slave exhibit the
-- echo ### same number of queries in slow log: $master_slow_query
@@ -276,7 +276,7 @@ let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text
-- sync_slave_with_master
let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
-if (`SELECT $master_slow_query != $slave_slow_query`)
+if ($master_slow_query != $slave_slow_query)
{
-- connection master
-- echo ***********************************************
@@ -293,7 +293,7 @@ if (`SELECT $master_slow_query != $slave_slow_query`)
-- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
}
-if (`SELECT $master_slow_query = $slave_slow_query`)
+if ($master_slow_query == $slave_slow_query)
{
-- echo ### Assertion is good. Both Master and Slave exhibit the
-- echo ### same number of queries in slow log: $master_slow_query
@@ -307,3 +307,4 @@ DROP TABLE t1;
-- sync_slave_with_master
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index b2e7418ce14..00815ab9d7e 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -692,13 +692,8 @@ drop function f1;
--echo #
--echo # Bug #11918 Can't use a declared variable in LIMIT clause
--echo #
---disable_warnings
-drop table if exists t1;
-drop procedure if exists p1;
---enable_warnings
-connection master;
--- source include/master-slave-reset.inc
-connection default;
+--source include/rpl_reset.inc
+
create table t1 (c1 int);
insert into t1 (c1) values
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -723,7 +718,7 @@ select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
-connection default;
+connection master;
--disable_warnings
call p1(-1);
--enable_warnings
@@ -731,7 +726,7 @@ select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
-connection default;
+connection master;
--echo # Cleanup
set @@session.binlog_format=@save_binlog_format;
@@ -743,3 +738,4 @@ drop procedure p1;
# Cleanup
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp004.test b/mysql-test/suite/rpl/t/rpl_sp004.test
index 2f9b329eb66..31e4ce37df7 100644
--- a/mysql-test/suite/rpl/t/rpl_sp004.test
+++ b/mysql-test/suite/rpl/t/rpl_sp004.test
@@ -89,3 +89,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_sl
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index 63ac3a8ad9c..df13ff253b1 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -261,3 +261,4 @@ SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creato
sync_slave_with_master;
--echo end of the tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_spec_variables.test b/mysql-test/suite/rpl/t/rpl_spec_variables.test
index a60738316c8..2cb580fce83 100644
--- a/mysql-test/suite/rpl/t/rpl_spec_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_spec_variables.test
@@ -304,3 +304,4 @@ SET @@global.storage_engine=@restore_slave_storage_engine;
call mtr.add_suppression("The table 't[12]' is full");
# End of 5.1 test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 6640544b0ed..592d13e67b0 100644
--- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
@@ -1,6 +1,3 @@
-#############################################################
-# 2006-02-07 By JBM added order by
-#############################################################
# test to see if replication can continue when master sporadically fails on
# COM_BINLOG_DUMP and additionally limits the number of events per dump
@@ -13,10 +10,8 @@ truncate table t1;
# We have to use 4 in the following to make this test work with all table types
insert into t1 values (4),(NULL);
sync_slave_with_master;
-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;
insert into t1 values (NULL),(NULL);
flush logs;
@@ -28,4 +23,4 @@ connection master;
drop table t1,t2;
sync_slave_with_master;
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 0f216983a32..43289428d45 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -75,7 +75,7 @@ source include/check_slave_is_running.inc;
let $slave_count= `select count(*) from t1`;
-if (`select $slave_count != $master_count`)
+if ($slave_count != $master_count)
{
echo master and slave differed in number of rows;
echo master: $master_count;
@@ -97,4 +97,14 @@ drop user replssl@localhost;
drop table t1;
sync_slave_with_master;
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_user = 'root',
+ master_ssl = 0,
+ master_ssl_ca = '',
+ master_ssl_cert = '',
+ master_ssl_key = '';
+
--echo End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test
index 152f307fd31..f5f63a00033 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl1.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test
@@ -10,7 +10,6 @@ connection master;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
-#syncing with master
sync_slave_with_master;
#trying to use this user without ssl
@@ -57,6 +56,7 @@ start slave;
connection master;
drop user replssl@localhost;
drop table t1;
+
sync_slave_with_master;
source include/show_slave_status.inc;
source include/check_slave_is_running.inc;
@@ -91,6 +91,19 @@ select * from t1;
source include/show_slave_status.inc;
--source include/check_slave_is_running.inc
+# ==== Clean up ====
+
connection master;
drop table t1;
sync_slave_with_master;
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_host="127.0.0.1",
+ master_ssl_ca ='',
+ master_ssl_cert='',
+ master_ssl_key='',
+ master_ssl_verify_server_cert=0,
+ master_ssl=0;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test
index aee067b2d4a..268a10ad1fa 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_000001.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test
@@ -1,2 +1,128 @@
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_stm_000001.test
+# Requires binlog_format=statement format since query involving
+# get_lock() is logged in row format if binlog_format=mixed or row.
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--let $engine_type= myisam
+
+# Load some data into t1
+create table t1 (word char(20) not null);
+load data infile '../../std_data/words.dat' into table t1;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
+select * from t1 limit 10;
+
+#
+# Test slave with wrong password
+#
+sync_slave_with_master;
+stop slave;
+connection master;
+set password for root@"localhost" = password('foo');
+connection slave;
+start slave;
+connection master;
+#
+# Give slave time to do at last one failed connect retry
+# This one must be short so that the slave will not stop retrying
+real_sleep 2;
+set password for root@"localhost" = password('');
+# Give slave time to connect (will retry every second)
+sleep 2;
+
+create table t3(n int);
+insert into t3 values(1),(2);
+sync_slave_with_master;
+select * from t3;
+select sum(length(word)) from t1;
+connection master;
+drop table t1,t3;
+sync_slave_with_master;
+
+# Test if the slave SQL thread can be more than 16K behind the slave
+# I/O thread (> IO_SIZE)
+
+connection master;
+# we'll use table-level locking to delay slave SQL thread
+eval create table t1 (n int) engine=$engine_type;
+sync_slave_with_master;
+connection master;
+reset master;
+connection slave;
+stop slave;
+reset slave;
+
+connection master;
+let $1=5000;
+# Generate 16K of relay log
+disable_query_log;
+while ($1)
+{
+ eval insert into t1 values($1);
+ dec $1;
+}
+enable_query_log;
+
+# Try to cause a large relay log lag on the slave by locking t1
+connection slave;
+lock tables t1 read;
+start slave;
+connection master;
+--source include/sync_slave_io_with_master.inc
+unlock tables;
+
+#test handling of aborted connection in the middle of update
+
+connection master;
+create table t2(id int);
+insert into t2 values(connection_id());
+
+connection master1;
+# Avoid generating result
+create temporary table t3(n int);
+--disable_warnings
+insert into t3 select get_lock('crash_lock%20C', 1) from t2;
+--enable_warnings
+
+connection master;
+send update t1 set n = n + get_lock('crash_lock%20C', 2);
+connection master1;
+sleep 3;
+select (@id := id) - id from t2;
+kill @id;
+# We don't drop t3 as this is a temporary table
+drop table t2;
+connection master;
+# The get_lock function causes warning for unsafe statement.
+--disable_warnings
+--error 1317,2013
+reap;
+--enable_warnings
+connection slave;
+# The SQL slave thread should now have stopped because the query was killed on
+# the master (so it has a non-zero error code in the binlog).
+# 1053 = ER_SERVER_SHUTDOWN
+--let $slave_sql_errno= 1053
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+select count(*) from t1;
+connection master1;
+drop table t1;
+create table t1 (n int);
+insert into t1 values(3456);
+insert into mysql.user (Host, User, Password)
+ VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
+select select_priv,user from mysql.user where user = _binary'blafasel2';
+update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
+select select_priv,user from mysql.user where user = _binary'blafasel2';
+sync_slave_with_master;
+select n from t1;
+select select_priv,user from mysql.user where user = _binary'blafasel2';
+connection master1;
+drop table t1;
+delete from mysql.user where user="blafasel2";
+sync_slave_with_master;
+
+# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test b/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
index a996c6fac66..e8e20438d1d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
@@ -105,3 +105,4 @@ DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
enable_warnings;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt
deleted file mode 100644
index 45631525481..00000000000
--- a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680
diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
index 7e43b7a9e7d..352213304b6 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
@@ -5,3 +5,4 @@
--source include/have_binlog_format_statement.inc
--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
index 07b7a0bf8f7..cd9e71cbff9 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
@@ -1,11 +1,6 @@
-# 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;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
index b46da8a0150..6e3dabf6e32 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
@@ -8,3 +8,4 @@
--source include/have_innodb.inc
--source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
index e24eb718c47..d8a3ad23b66 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
@@ -3,6 +3,3 @@
let $rename_event_pos= 959;
-- source extra/rpl_tests/rpl_flsh_tbls.test
-
-# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012. Delete me if needed.
diff --git a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
index 2d8d480b910..1ec8f8a0424 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
@@ -119,7 +119,5 @@ DROP TABLE t1, logtbl;
DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
-sync_slave_with_master;
-
-source include/reset_master_and_slave.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
index f3a4b174ab3..ae59008c3ee 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
@@ -8,3 +8,4 @@
--let $engine=Innodb
set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_innodb.test b/mysql-test/suite/rpl/t/rpl_stm_innodb.test
index 5b3fef9c66b..cecf9ec7bcd 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_innodb.test
@@ -6,3 +6,4 @@ source include/have_innodb.inc;
source include/have_binlog_format_mixed_or_statement.inc;
source extra/rpl_tests/rpl_innodb.test;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
index 3db3f7d9fcd..92d57625283 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
@@ -2,7 +2,9 @@
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
+
disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
--source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
index c27348ce987..5d2c85b2cb6 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
@@ -22,3 +22,4 @@ enable_query_log;
-- source extra/rpl_tests/rpl_loadfile.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_log.test b/mysql-test/suite/rpl/t/rpl_stm_log.test
index 7bc17fbaada..7e7e1d4033f 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_log.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_log.test
@@ -7,3 +7,4 @@ let $engine_type=MyISAM;
# End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012: Delete me
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
index 950aa8b322a..1a7139c889a 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
@@ -6,6 +6,3 @@
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_max_relay_size.test
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
index 523e883d9fa..537d304687c 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
@@ -16,3 +16,4 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_show_relaylog_events.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
index f32ab1f01f0..f13057a7d83 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
@@ -13,7 +13,7 @@ let $engine_type=Innodb;
# BUG#49522: Replication problem with mixed MyISAM/InnoDB
#
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
CREATE TABLE `t1` (
@@ -37,12 +37,11 @@ SET AUTOCOMMIT=1;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE `t1`;
-- sync_slave_with_master
--- source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_multi_query.test b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
index c39d1fad015..e234f4b9622 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
@@ -3,10 +3,5 @@
# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
# one binlog event containing all queries)
-# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_multi_query.test
-
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/suite/rpl/t/rpl_stm_no_op.test b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
index 66dc89bd712..1605b177ac4 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_no_op.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
@@ -91,3 +91,4 @@ select * from t2;
connection master;
drop table t1, t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test b/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test
index d5aac4a43e2..0eb41d1c6bd 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test
@@ -22,3 +22,4 @@ DROP TABLE t1;
-- echo # duplicate key error (because it has received event
-- echo # with expected error code).
-- sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
index 7701cd7aa06..ada080e9071 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
@@ -5,5 +5,22 @@
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
+# make innodb updates run fast
+--connection slave
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
+--connection master
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
+
SET @@session.binlog_direct_non_transactional_updates= FALSE;
--source ./extra/rpl_tests/rpl_start_stop_slave.test
+
+# clean up
+--connection slave
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+--connection master
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
index dd3bf1a7f56..84d663298c4 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
@@ -8,3 +8,4 @@
SET @@session.binlog_direct_non_transactional_updates= FALSE;
-- source extra/rpl_tests/rpl_stop_middle_group.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 12782589b0d..4e9ccc2b0cf 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -72,7 +72,7 @@ select * from t1;
--let $slave_param_value= $master_log_pos_1
--source include/check_slave_param.inc
-let $relay_log_file= slave-relay-bin.000004;
+let $relay_log_file= slave-relay-bin.000003;
let $master_log_pos= $master_log_pos_2;
source include/get_relay_log_pos.inc;
# try replicate all up to and not including the second insert to t2;
@@ -195,24 +195,18 @@ sync_with_master;
# to substitute the genuine one with a prepared on 4.1 server.
#
---source include/master-slave-reset.inc
+--source include/rpl_reset.inc
connection master;
-drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001
-sync_slave_with_master;
-connection slave;
-stop slave;
-connection master;
-
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/master-bin.000001
--copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
# this a constant bound to the bug47142_master-bin.000001 binlog file
--let $binlog_before_drop=294;
-flush logs;
connection slave;
+stop slave;
reset slave;
--replace_regex /master_log_pos=[0-9]+/master_log_pos=MASTER_LOG_POS/
eval start slave until master_log_file='master-bin.000001', master_log_pos=$binlog_before_drop /* to stop right before DROP */;
@@ -224,9 +218,7 @@ show tables /* t1 must exist */;
drop table t1; # drop on slave only, master does not have t1.
stop slave;
-reset slave;
-
-connection master;
-reset master;
# End of tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
index 05adc597776..2045dd6ae57 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
@@ -43,8 +43,7 @@ CREATE TABLE t1 (`tinyint` TINYINT,
-- echo #########################################
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -74,8 +73,7 @@ INSERT INTO t1 VALUES (@positive,
-- echo #########################################
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -94,8 +92,7 @@ TRUNCATE t1;
-- echo #########################################
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -126,8 +123,7 @@ INSERT INTO t1 VALUES (@negative,
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -145,7 +141,7 @@ DROP TABLE t1;
# BUG#51426
#
#####################################################################
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
@@ -162,8 +158,7 @@ INSERT INTO t1 VALUES (@aux) , (@aux1);
-- sync_slave_with_master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
--connection master
@@ -172,3 +167,4 @@ DROP TABLE t1;
-- sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
new file mode 100644
index 00000000000..296b002dbb7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -0,0 +1,119 @@
+source include/master-slave.inc;
+source include/have_innodb.inc;
+source include/have_debug.inc;
+source include/have_debug_sync.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+--echo
+--echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+--echo #
+--echo # If a temporary table is created or dropped, the transaction should be
+--echo # regarded similarly that a non-transactional table is modified. So
+--echo # STOP SLAVE should wait until the transaction has finished.
+
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+
+sync_slave_with_master;
+SET DEBUG_SYNC= 'RESET';
+source include/stop_slave.inc;
+
+--echo
+--echo # Suspend the INSERT statement in current transaction on SQL thread.
+--echo # It guarantees that SQL thread is applying the transaction when
+--echo # STOP SLAVE command launchs.
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug= 'd,after_mysql_insert';
+source include/start_slave.inc;
+
+--echo
+--echo # CREATE TEMPORARY TABLE with InnoDB engine
+--echo # -----------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo
+--echo # CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+--echo # ----------------------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+ SELECT c1 FROM t2;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+# Don't need to verify 'CREATE TEMPORARY TABLE' with MyIASM engine, as it
+# never is binlogged into a transaction since 5.5.
+
+--echo
+--echo # Test end
+SET GLOBAL debug= '$debug_save';
+source include/restart_slave_sql.inc;
+
+connection slave;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1, t2;
+
+--echo
+--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
+--echo # ----------------------------------------------------------------------
+--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
+--echo # possible that IO thread stopped after replicating part of a transaction
+--echo # which SQL thread was executing. SQL thread would be hung if the
+--echo # transaction could not be rolled back safely.
+--echo # It caused some sporadic failures on PB2.
+--echo #
+--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
+--echo # thread will continue to fetch the rest events of the transaction which
+--echo # is being executed by SQL thread and is not able to be rolled back safely.
+
+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1, 1);
+
+sync_slave_with_master;
+
+--source include/rpl_connection_master.inc
+
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
+
+--source include/rpl_connection_slave.inc
+source include/restart_slave_sql.inc;
+
+BEGIN;
+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
+
+--source include/rpl_connection_master.inc
+BEGIN;
+INSERT INTO t1 VALUES(2, 2);
+INSERT INTO t2 VALUES(1);
+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
+COMMIT;
+
+--source include/rpl_connection_slave1.inc
+let $show_statement= SHOW PROCESSLIST;
+let $field= Info;
+let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
+source include/wait_show_condition.inc;
+
+send STOP SLAVE;
+
+--source include/rpl_connection_slave.inc
+ROLLBACK;
+
+--source include/rpl_connection_master.inc
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+--source include/rpl_connection_slave.inc
+source include/wait_for_slave_to_stop.inc;
+
+--source include/rpl_connection_slave1.inc
+reap;
+source include/start_slave.inc;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1, t2;
+SET GLOBAL debug= $debug_save;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index 63efcbeec04..6dab08ac503 100644
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
@@ -621,3 +621,4 @@ sync_slave_with_master;
connection master;
# Restore binlog format setting
set global binlog_format =@my_binlog_format;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
index fba451a5b3e..3816e61bb1e 100644
--- a/mysql-test/suite/rpl/t/rpl_sync-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
@@ -1 +1,2 @@
--sync-relay-log-info=1 --relay-log-recovery=1 --innodb_file_format_check=1 --default-storage-engine=MyISAM --innodb-file-per-table=0
+--skip-core-file
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
index 48c8dc02efb..e1750be0ff6 100644
--- a/mysql-test/suite/rpl/t/rpl_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -31,6 +31,7 @@
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_innodb.inc
+--source include/not_crashrep.inc
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
@@ -50,8 +51,7 @@ connection slave;
let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
-stop slave SQL_THREAD;
-source include/wait_for_slave_sql_to_stop.inc;
+--source include/stop_slave_sql.inc
connection master;
insert into t1(a) values(4);
@@ -60,8 +60,7 @@ insert into t1(a) values(6);
--echo =====Removing relay log files and crashing/recoverying the slave=======;
connection slave;
-stop slave IO_THREAD;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
@@ -79,18 +78,16 @@ SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
FLUSH LOGS;
---enable_reconnect
---source include/wait_until_connected_again.inc
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
--echo =====Dumping and comparing tables=======;
-start slave;
-source include/wait_for_slave_to_start.inc;
+--source include/start_slave.inc
connection master;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables=master:t1,slave:t1;
source include/diff_tables.inc;
########################################################################################
@@ -98,8 +95,7 @@ source include/diff_tables.inc;
########################################################################################
--echo =====Corrupting the master.info=======;
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
connection master;
FLUSH LOGS;
@@ -130,18 +126,16 @@ SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
FLUSH LOGS;
---enable_reconnect
---source include/wait_until_connected_again.inc
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
--echo =====Dumping and comparing tables=======;
-start slave;
-source include/wait_for_slave_to_start.inc;
+--source include/start_slave.inc
connection master;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables=master:t1,slave:t1;
source include/diff_tables.inc;
########################################################################################
@@ -150,3 +144,7 @@ source include/diff_tables.inc;
--echo =====Clean up=======;
connection master;
drop table t1;
+
+--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test
index 62c3633b7b2..92f8cef9c10 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table.test
@@ -64,3 +64,6 @@ connect (master2,localhost,root,,);
connection master2;
drop table if exists t1,t2;
sync_slave_with_master;
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
index e19c3019aa1..63f0b6c2234 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
@@ -11,6 +11,7 @@
source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
+source include/have_innodb.inc;
--echo ==== Initialize ====
@@ -31,6 +32,7 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
--connection master
disconnect master;
+--echo [on master1]
--connection master1
# waiting DROP TEMPORARY TABLE event to be written into binlog
@@ -46,7 +48,10 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
--echo ==== Clean up ====
--echo [on master]
---connection master1
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+--connection master
DROP TABLE t1;
--echo [on slave]
@@ -88,8 +93,7 @@ sync_slave_with_master;
# 10. in the end the slave should not have open temp tables.
#
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
# action: setup environment
@@ -146,3 +150,61 @@ DROP TABLE t3, t1;
-- sync_slave_with_master
-- source include/show_binlog_events.inc
+
+--echo
+--echo # Bug#55478 Row events wrongly apply on the temporary table of the same name
+--echo # ==========================================================================
+connection master;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo # The statement should be binlogged
+CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
+
+--echo
+--echo # Case 1: CREATE TABLE t1 ... SELECT
+--echo # ----------------------------------
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # The statement generates row events on t1. And the rows events should
+--echo # be inserted into the base table on slave.
+CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
+
+source include/show_binlog_events.inc;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Case 2: DROP TEMPORARY TABLE in a transacation
+--echo # ----------------------------------------------
+--echo
+
+BEGIN;
+DROP TEMPORARY TABLE t1;
+
+# The patch for BUG#55478 fixed the problem only on RBR. The problem on SBR
+# will be fixed by the patch for bug#55709. So This statement cannot be
+# executed until Bug#55709 is fixed
+#
+# INSERT INTO t1 VALUES(1);
+
+--echo # The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
+--echo # as t1 is non-transactional table
+INSERT INTO t1 VALUES(Rand());
+COMMIT;
+
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+
+--echo # Compare the base table.
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+--echo
+connection master;
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index 7a66a55d510..878589ef006 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
@@ -313,12 +313,15 @@ select * from t1;
connection master;
drop table t1;
--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
+--sync_slave_with_master
-# Delete the anonymous users
-SET sql_log_bin = 0;
+# Delete the anonymous users.
+--source include/stop_slave.inc
source include/delete_anonymous_users.inc;
-SET sql_log_bin = 1;
-
+--connection master
+source include/delete_anonymous_users.inc;
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
#
@@ -350,9 +353,7 @@ connection slave;
DROP USER user43748@127.0.0.1;
---echo -- done. back to master.
-connection master;
-
-
--echo End of 5.1 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt b/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt
index 80c171170f6..b37427aa2cd 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt
@@ -1,3 +1,2 @@
--loose-debug="+d,all_errors_are_temporary_errors" --slave-transaction-retries=2
-
-
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
index f05cf73c6ed..07b23e10847 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
@@ -26,8 +26,12 @@ set @@global.slave_exec_mode= default;
SHOW STATUS LIKE 'Slave_retried_transactions';
SELECT * FROM t1;
source include/check_slave_is_running.inc;
-DROP TABLE t1;
+
+connection slave;
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
--echo **** On Master ****
connection master;
DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_test_framework.cnf b/mysql-test/suite/rpl/t/rpl_test_framework.cnf
new file mode 100644
index 00000000000..8934d1c9ae1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_test_framework.cnf
@@ -0,0 +1,46 @@
+!include ../my.cnf
+[mysqld.1]
+log-slave-updates
+[mysqld.2]
+log-slave-updates
+[mysqld.3]
+log-slave-updates
+[mysqld.4]
+log-slave-updates
+[mysqld.5]
+log-slave-updates
+[mysqld.6]
+log-slave-updates
+[mysqld.7]
+log-slave-updates
+[mysqld.8]
+log-slave-updates
+[mysqld.9]
+log-slave-updates
+#[mysqld.10]
+#log-slave-updates
+#[mysqld.11]
+#log-slave-updates
+#[mysqld.12]
+#log-slave-updates
+#[mysqld.13]
+#log-slave-updates
+#[mysqld.14]
+#log-slave-updates
+#[mysqld.15]
+#log-slave-updates
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYPORT_5= @mysqld.5.port
+SERVER_MYPORT_6= @mysqld.6.port
+SERVER_MYPORT_7= @mysqld.7.port
+SERVER_MYPORT_8= @mysqld.8.port
+SERVER_MYPORT_9= @mysqld.9.port
+#SERVER_MYPORT_10= @mysqld.10.port
+#SERVER_MYPORT_11= @mysqld.11.port
+#SERVER_MYPORT_12= @mysqld.12.port
+#SERVER_MYPORT_13= @mysqld.13.port
+#SERVER_MYPORT_14= @mysqld.14.port
+#SERVER_MYPORT_15= @mysqld.15.port
diff --git a/mysql-test/suite/rpl/t/rpl_test_framework.test b/mysql-test/suite/rpl/t/rpl_test_framework.test
new file mode 100644
index 00000000000..e0f961caff1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_test_framework.test
@@ -0,0 +1,143 @@
+# ==== Purpose ====
+#
+# Test that the sync chain generated by
+# include/rpl_change_topology.inc (sourced from include/rpl_init.inc)
+# is correct.
+#
+# We test a number of different topologies. Each topology is tested
+# in extra/rpl_tests/rpl_test_framework.inc. See
+# extra/rpl_tests/rpl_test_framework.inc for details on how the sync
+# chain is tested.
+#
+# ==== Related bugs ====
+#
+# BUG#49978: Replication tests don't clean up replication state at the end
+
+
+# We only need to execute this test once. Also, we rely on 'DELETE
+# FROM t1' to remove rows in slave tables that don't exist in master
+# tables (see include/rpl_test_framework.inc for details).
+--source include/have_binlog_format_statement.inc
+
+
+--echo ==== Create t1 on all servers. ====
+if ($mtr_supports_more_than_10_servers)
+{
+ --let $rpl_server_count= 15
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15
+}
+if (!$mtr_supports_more_than_10_servers)
+{
+ --let $rpl_server_count= 9
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9
+}
+--source include/rpl_init.inc
+CREATE TABLE t1 (a INT);
+--source include/rpl_end.inc
+
+# Initialize $next_number before first call to
+# extra/rpl_tests/rpl_test_framework.text
+--let $next_number= 0
+
+
+--echo ==== Test 3-server topologies ====
+
+--let $rpl_server_count= 3
+
+--let $rpl_topology= 1 -> 2
+--let $masters= 1,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 2 -> 3
+--let $masters= 1,2
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= none
+--let $masters= 1,2,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2, 2->1
+--let $masters= 1,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2->1
+--let $masters= 2,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 2->1->2
+--let $masters= 1,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2->3
+--let $masters= 1
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 2->3->2->1
+--let $masters= 3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2,2->3,3->1
+--let $masters= 3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->3->2->1
+--let $masters= 3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+
+--echo ==== Test 6-server topologies ====
+
+--let $rpl_server_count= 6
+
+--let $rpl_topology= 1->2->3->4->1->5->6
+--let $masters= 1
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 3->4->5->6->3->1->2
+--let $masters= 4
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 6->5->4->3->2->1
+--let $masters= 6
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2->3->1,4->5->6
+--let $masters= 3,4
+--source extra/rpl_tests/rpl_test_framework.inc
+
+
+--echo ==== Test 9-server topology ====
+
+--let $rpl_server_count= 9
+
+--let $rpl_topology= 1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9
+--let $masters= 2
+--source extra/rpl_tests/rpl_test_framework.inc
+
+if ($mtr_supports_more_than_10_servers) {
+--echo ==== Test 15-server topologies ====
+
+--let $rpl_server_count= 15
+
+--let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15->1
+--let $masters= 2
+--source extra/rpl_tests/rpl_test_framework.inc
+
+# This is a binary tree
+--let $rpl_topology= 1->2->4->8,1->3->6->12,2->5->10,3->7->14,4->9,5->11,6->13,7->15
+--let $masters= 1
+--source extra/rpl_tests/rpl_test_framework.inc
+}
+
+--echo ==== Clean up ====
+
+if ($mtr_supports_more_than_10_servers) {
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15
+}
+if (!$mtr_supports_more_than_10_servers) {
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9
+}
+--source include/rpl_init.inc
+--connection server_1
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test
index 1b380062dd7..7355106b6b4 100644
--- a/mysql-test/suite/rpl/t/rpl_timezone.test
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test
@@ -168,6 +168,8 @@ SET @@session.time_zone = default;
connection master;
DROP TABLE t1;
SET @@session.time_zone = default;
+--sync_slave_with_master
+--source include/stop_slave.inc
# Bug#41719 delayed INSERT into timestamp col needs set time_zone for concurrent binlogging
# To test that time_zone is correctly binloging for 'insert delayed' statement
@@ -200,4 +202,7 @@ select * from t1 order by a;
DROP TABLE t1;
SET @@session.time_zone = default;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
+
--echo End of 5.0 tests
diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
index b30548d0e45..aa22b23925c 100644
--- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
@@ -20,6 +20,7 @@ sync_slave_with_master;
# to stop.
#
+--connection master
--disable_abort_on_error
CREATE TABLE t1 (a CHAR(30));
@@ -155,5 +156,4 @@ DROP PROCEDURE p2;
DROP EVENT e2;
DROP TABLE t1, t2;
---source include/master-slave-end.inc
-
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 5642b865e6e..e2974a21bf7 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -319,24 +319,19 @@ let $MYSQLD_DATADIR= `select @@datadir`;
FLUSH LOGS;
# 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
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.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 $rpl_server_number= 1
+--source include/rpl_start_server.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
@@ -512,7 +507,8 @@ sync_slave_with_master;
#
connection master;
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
+
connection slave;
connection master;
@@ -529,12 +525,10 @@ insert into t1 values ( 1 );
rollback;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
--source include/diff_tables.inc
-let $diff_table_1=master:test.log;
-let $diff_table_2=slave:test.log;
+let $diff_tables= master:log, slave:log;
--source include/diff_tables.inc
connection master;
@@ -544,3 +538,4 @@ sync_slave_with_master;
#
# End of tests
#
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
index 88ecb7c18b0..0e7d5483f62 100644
--- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
@@ -52,3 +52,6 @@ let $wait_binlog_event= DROP;
source include/wait_for_binlog_event.inc;
show status like 'Slave_open_temp_tables';
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
index a0f0ea04f44..bea6332963e 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
@@ -1,4 +1,3 @@
--source include/not_ndb_default.inc
let $engine=MyISAM;
--source extra/rpl_tests/rpl_truncate.test
-
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
index a31fd62a29a..093cf56a316 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
@@ -1,6 +1,4 @@
-
--source include/have_innodb.inc
--source include/not_ndb_default.inc
-
let $engine=InnoDB;
--source extra/rpl_tests/rpl_truncate.test
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv-master.opt b/mysql-test/suite/rpl/t/rpl_typeconv-master.opt
new file mode 100644
index 00000000000..de048691031
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_typeconv-master.opt
@@ -0,0 +1 @@
+--testcase-timeout=40
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test
index 2a6a3f3b33d..efcbe97049f 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv.test
@@ -61,9 +61,12 @@ SELECT RPAD(Source, 15, ' ') AS Source_Type,
enable_query_log;
DROP TABLE type_conversions;
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677");
+
connection master;
DROP TABLE t1;
sync_slave_with_master;
set global slave_type_conversions = @saved_slave_type_conversions;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test b/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
index 729a622348f..ba2172106b6 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
@@ -6,8 +6,6 @@
# BUG#49618: Field length stored incorrectly in binary log for InnoDB
#
-source include/reset_master_and_slave.inc;
-
connection slave;
SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
@@ -17,13 +15,12 @@ CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (b'0', b'01', b'101');
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
DROP TABLE t1;
sync_slave_with_master;
-connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_udf.test b/mysql-test/suite/rpl/t/rpl_udf.test
index b52fea144ba..8643654f2a1 100644
--- a/mysql-test/suite/rpl/t/rpl_udf.test
+++ b/mysql-test/suite/rpl/t/rpl_udf.test
@@ -13,3 +13,5 @@ enable_query_log;
let $engine_type= MyISAM;
--source include/rpl_udf.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_user.test b/mysql-test/suite/rpl/t/rpl_user.test
index b8fe41d03c4..caa17b47733 100644
--- a/mysql-test/suite/rpl/t/rpl_user.test
+++ b/mysql-test/suite/rpl/t/rpl_user.test
@@ -59,3 +59,4 @@ select Host,User from mysql.user where Host='fakehost';
#
connection master;
source include/show_binlog_events.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test
index 915bcb9ae65..dd6ddf39580 100644
--- a/mysql-test/suite/rpl/t/rpl_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_user_variables.test
@@ -381,4 +381,5 @@ DROP FUNCTION f2;
DROP TABLE t1;
sync_slave_with_master;
-stop slave;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index 6c3b3ab6d8a..c3a6f6e273e 100644
--- a/mysql-test/suite/rpl/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
@@ -109,14 +109,11 @@ SET @user_text = 'Alunda';
# Stop slave so that we get a fresh sql thread, reading the slave's
# global values of variables into its local copies.
---echo [on master]
-connection master;
-source include/reset_master_and_slave.inc;
+--source include/stop_slave.inc
+--source include/start_slave.inc
# We would have wanted to set this together with the other variables
# above, but can't because it affects how the slave works.
---echo [on slave]
-connection slave;
SET @@global.init_slave = 'SELECT 1';
@@ -674,35 +671,19 @@ EXECUTE p49; EXECUTE p50; EXECUTE p51; EXECUTE p52; EXECUTE p53; EXECUTE p54;
EXECUTE p55; EXECUTE p56; EXECUTE p57; EXECUTE p58; EXECUTE p59; EXECUTE p60;
EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64;
+--sync_slave_with_master
+--connection master
+
--echo ==== Results ====
# Show the result in table test.tstmt on master...
SELECT * FROM tstmt ORDER BY id;
-let $diff_table_1=master:test.tstmt;
-# ... then compare test.tstmt on master to the other tables on master...
-let $diff_table_2=master:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tprep;
-source include/diff_tables.inc;
+--sync_slave_with_master
-# ... and to all tables on slave.
-connection master;
-sync_slave_with_master;
-let $diff_table_2=slave:test.tstmt;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tprep;
+# ... then compare test.tstmt on master to the other tables on master and slave.
+let $diff_tables= master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep;
source include/diff_tables.inc;
@@ -737,3 +718,4 @@ SET @@global.sync_binlog= @s_sync_binlog;
connection master;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_variables_stm.test b/mysql-test/suite/rpl/t/rpl_variables_stm.test
index 9e9bff03830..8943585bc1d 100644
--- a/mysql-test/suite/rpl/t/rpl_variables_stm.test
+++ b/mysql-test/suite/rpl/t/rpl_variables_stm.test
@@ -571,34 +571,19 @@ EXECUTE p49; EXECUTE p50; EXECUTE p51; EXECUTE p52; EXECUTE p53; EXECUTE p54;
EXECUTE p55; EXECUTE p56; EXECUTE p57; EXECUTE p58; EXECUTE p59; EXECUTE p60;
EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64;
+--sync_slave_with_master
+--connection master
+
--echo ==== Results ====
# Show the result in table test.tstmt on master...
SELECT * FROM tstmt ORDER BY id;
-let $diff_table_1=master:test.tstmt;
-# ... then compare test.tstmt on master to the other tables on master...
-let $diff_table_2=master:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tprep;
-source include/diff_tables.inc;
+--sync_slave_with_master
-# ... and to all tables on slave.
-sync_slave_with_master;
-let $diff_table_2=slave:test.tstmt;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tprep;
+# ... then compare test.tstmt on master to the other tables on master and slave.
+let $diff_tables= master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep;
source include/diff_tables.inc;
@@ -633,3 +618,4 @@ SET @@global.collation_database= @s_collation_database;
connection master;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test
index 01b4dc5ef55..3f0052cd544 100644
--- a/mysql-test/suite/rpl/t/rpl_view.test
+++ b/mysql-test/suite/rpl/t/rpl_view.test
@@ -177,3 +177,4 @@ DROP TABLE t1;
sync_slave_with_master;
--echo End of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_view_multi.test b/mysql-test/suite/rpl/t/rpl_view_multi.test
index 5b3e7cf76f8..22509f8e4fc 100644
--- a/mysql-test/suite/rpl/t/rpl_view_multi.test
+++ b/mysql-test/suite/rpl/t/rpl_view_multi.test
@@ -143,3 +143,4 @@ drop table t1, t2;
drop view v1;
--echo # Syncing slave with master and switching to connection 'slave'
--sync_slave_with_master
+--source include/rpl_end.inc