summaryrefslogtreecommitdiff
path: root/mysql-test/extra/rpl_tests
diff options
context:
space:
mode:
authorSven Sandberg <sven.sandberg@oracle.com>2010-12-19 18:07:28 +0100
committerSven Sandberg <sven.sandberg@oracle.com>2010-12-19 18:07:28 +0100
commit8b27f9a05e2f49191b57b8717a31753573981fe7 (patch)
tree2b7870f89dd67878d42123d7595b06337a4f5e67 /mysql-test/extra/rpl_tests
parent2269988b7570bd0a78a92ee3778590cde5b1b90f (diff)
downloadmariadb-git-8b27f9a05e2f49191b57b8717a31753573981fe7.tar.gz
BUG#49978: Replication tests don't clean up replication state at the end
Major replication test framework cleanup. This does the following: - Ensure that all tests clean up the replication state when they finish, by making check-testcase check the output of SHOW SLAVE STATUS. This implies: - Slave must not be running after test finished. This is good because it removes the risk for sporadic errors in subsequent tests when a test forgets to sync correctly. - Slave SQL and IO errors must be cleared when test ends. This is good because we will notice if a test gets an unexpected error in the slave threads near the end. - We no longer have to clean up before a test starts. - Ensure that all tests that wait for an error in one of the slave threads waits for a specific error. It is no longer possible to source wait_for_slave_[sql|io]_to_stop.inc when there is an error in one of the slave threads. This is good because: - If a test expects an error but there is a bug that causes another error to happen, or if it stops the slave thread without an error, then we will notice. - When developing tests, wait_for_*_to_[start|stop].inc will fail immediately if there is an error in the relevant slave thread. Before this patch, we had to wait for the timeout. - Remove duplicated and repeated code for setting up unusual replication topologies. Now, there is a single file that is capable of setting up arbitrary topologies (include/rpl_init.inc, but include/master-slave.inc is still available for the most common topology). Tests can now end with include/rpl_end.inc, which will clean up correctly no matter what topology is used. The topology can be changed with include/rpl_change_topology.inc. - Improved debug information when tests fail. This includes: - debug info is printed on all servers configured by include/rpl_init.inc - User can set $rpl_debug=1, which makes auxiliary replication files print relevant debug info. - Improved documentation for all auxiliary replication files. Now they describe purpose, usage, parameters, and side effects. - Many small code cleanups: - Made have_innodb.inc output a sensible error message. - Moved contents of rpl000017-slave.sh into rpl000017.test - Added mysqltest variables that expose the current state of disable_warnings/enable_warnings and friends. - Too many to list here: see per-file comments for details. client/mysqltest.cc: Added the following variables: $ENABLED_WARNINGS $ENABLED_QUERY_LOG $ENABLED_RESULT_LOG $ENABLED_ABORT_ON_ERROR $ENABLED_INFO $ENABLED_METADATA Each variable is 0 or 1, depending on if the corresponding mysqltest feature is on or off. mysql-test/extra/rpl_tests/rpl_EE_err.test: Made test clean up after itself and removed outdated comments. mysql-test/extra/rpl_tests/rpl_auto_increment.test: - Use rpl_reset.inc instead of master-slave-reset.inc - diff_tables.inc now takes only one parameter. Made test clean up after itself and removed outdated comments. mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test: diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test: diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test: diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_charset.test: Made test clean up after itself and removed unnecessary cleanup in beginning. mysql-test/extra/rpl_tests/rpl_commit_after_flush.test: cosmetic fixes mysql-test/extra/rpl_tests/rpl_conflicts.test: cosmetic fixes mysql-test/extra/rpl_tests/rpl_ddl.test: Don't clean up replication here since this file does not setup replication. The main test now has to both setup and clean up replication. cosmetic fixes mysql-test/extra/rpl_tests/rpl_deadlock.test: make test clean up after itself mysql-test/extra/rpl_tests/rpl_extra_col_master.test: cosmetic fixes mysql-test/extra/rpl_tests/rpl_extra_col_slave.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_failed_optimize.test: made test clean up after itself mysql-test/extra/rpl_tests/rpl_flsh_tbls.test: made test clean up after itself mysql-test/extra/rpl_tests/rpl_foreign_key.test: made test clean up after itself mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test: - Replace 'start slave; wait_for_slave_to_start.inc' by include/start_slave.inc. - Use new file rpl_connect.inc to reconnect on all connections, since the connections are used by rpl_end.inc. - Use wait_for_slave_param.inc instead of wait_for_slave_io_to_start.inc, since wait_for_slave_io_to_start.inc now fails if the IO thread has an error. In this particular test case, it is normal that the IO thread has an error. - Changed wait_for_slave_io_error.inc so that it waits for the IO thread to stop. However, in this test case, the IO thread only gets a non-fatal error, so it does not stop. So we set $slave_io_error_is_nonfatal=1 to prevent wait_for_slave_io_error.inc from waiting. mysql-test/extra/rpl_tests/rpl_insert_id.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_insert_id_pk.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_loaddata.test: - Use wait_for_slave_sql_error.inc to wait for errors instead of wait_for_slave_sql_to_stop.inc - Use check_slave_no_error.inc instead of print errors to the log. - Use rpl_reset.inc instead of master-slave-reset.inc This means we have to clear the error from the slave threads by calling RESET SLAVE explicitly. - diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_log.test: replace master-slave-reset.inc by rpl_reset.inc mysql-test/extra/rpl_tests/rpl_max_relay_size.test: made test clean up after itself cosmetic fix mysql-test/extra/rpl_tests/rpl_multi_query.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_multi_update.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test: replace master-slave-reset.inc by rpl_reset.inc mysql-test/extra/rpl_tests/rpl_not_null.test: - replace master-slave-reset.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_record_compare.test: - replace master-slave-reset.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_reset_slave.test: - replace wait_for_slave_io_error.inc+stop_slave.inc by wait_for_slave_io_error_and_stop.inc+stop_slave_sql.inc since stop_slave.inc now fails when the io thread has an error. - replace stop_slave.inc by STOP SLAVE + wait_for_slave_sql_to_stop.inc + wait_for_slave_param. stop_slave.inc would fail since the IO thread has an error. - add include/rpl_end.inc to clean up replication state mysql-test/extra/rpl_tests/rpl_row_UUID.test: Don't clean up replication here since this file does not setup replication. The main test now has to both setup and clean up replication. mysql-test/extra/rpl_tests/rpl_row_basic.test: - replaced reset_master_and_slave.inc by rpl_reset.inc - replaced sequence of reset master+reset slave by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_row_sp002.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_row_sp007.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_set_null.test: - replaced master-slave-reset.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test: - Made test clean up replication state. mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test: replaced rpl_diff_tables.inc by diff_tables.inc mysql-test/extra/rpl_tests/rpl_stop_slave.test: changed protocol for diff_tables.inc mysql-test/extra/rpl_tests/rpl_sv_relay_space.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_test_framework.inc: Auxiliary file used by rpl_test_framework.test. This checks that rpl_change_topology.inc works correctly. mysql-test/extra/rpl_tests/rpl_truncate.test: made test clean up after itself cosmetic fixes mysql-test/extra/rpl_tests/rpl_truncate_helper.test: - replace reset_master_and_slave.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/include/analyze-sync_with_master.test: - improved debug output printed when sync_slave_with_master or sync_with_master fails - Added documentation mysql-test/include/assert.inc: Added file to facilitate assertions. mysql-test/include/begin_include_file.inc: New auxiliary file to be used by replication helper files like rpl_init.inc, stop_slave.inc, wait_for_slave_*.inc, etc. Such helper files should source rpl_begin_include_file.inc at the beginning and rpl_end_include_file.inc at the end. That adds the following features: - When a test sources the file, the file name is printed to the result file. This is good because it makes result files easier to follow. - When a helper file sources a second helper file recursively, then the name of the second file is not printed. This is good because it would make the result file harder to follow if all the internal calls of all helper files were printed. - When $rpl_debug is set, all internal calls are printed to the result file. This is good because it helps when debugging test cases. (With $rpl_debug=1, many of the helper files now print other relevant debug info too.) - When a file needs to turn off the query log or the warning log (disable_query_log/disable_warnings), then the file can tell rpl_begin_include_file.inc about it. Then rpl_begin_include_file.inc will turn off the log correctly, and rpl_end_include_file.inc will turn on the log correctly. Note that if rpl_a.inc sources rpl_b.inc and both files need to turn off the log, then the log is not turned on when rpl_b.inc ends (because rpl_a.inc still needs the log off). This makes it easier to program replication helper files. mysql-test/include/check-testcase.test: Made check-testcase ensure that the slave status is reset after the test has finished. mysql-test/include/check_slave_is_running.inc: - Use existing framework (check_slave_param.inc) instead of ad-hoc code to check value of slave parameters. - Use rpl_begin_include_file.inc to improve debug capabilities. - improve documentation. mysql-test/include/check_slave_no_error.inc: - Use rpl_begin_include_file.inc to improve debug capabilities. - improve documentation. mysql-test/include/check_slave_param.inc: - Use rpl_begin_include_file.inc to improve debug capabilities. - improve documentation. mysql-test/include/cleanup_fake_relay_log.inc: - Use RESET SLAVE instead of manual file removal. This also resets other replication state. - verify that RESET SLAVE correctly removed files. mysql-test/include/diff_tables.inc: - Use rpl_begin_include_file.inc to improve debug capabilities. - Improved documentation. - file now supports an arbitrary number of tables (not just two). The tables are now given as a comma-separated list instead of as two variables. - You no longer have to specify database name for each table. If no database is specified, it defaults to the current database. - File now restores the connection at the end. mysql-test/include/end_include_file.inc: New file to be sourced at the end of auxiliary replication include files. See include/rpl_begin_include_file.inc for details. mysql-test/include/file_does_not_exist.inc: Added .inc file to check that a given file is removed. mysql-test/include/force_restart.inc: Added file to force server restart after test mysql-test/include/force_restart_if_skipped.inc: Added file to force server restart after test, if the test is skipped mysql-test/include/have_innodb.inc: Made have_innodb.inc print sensible message when innodb is not supported. mysql-test/include/io_thd_fault_injection.inc: Use rpl_server_restart.inc instead of restart_mysqld.inc in rpl tests mysql-test/include/kill_query_and_diff_master_slave.inc: Renamed diff_master_slave.inc to rpl_diff.inc mysql-test/include/master-slave.inc: - Use new rpl_init.inc file - Now, we don't do 'drop table' in master-slave.inc any more. That's good because drop table has nothing to do with configuring replication servers. - master-slave.inc now supports the additional parameter $rpl_server_count. By default, master-slave.inc only configures two servers; if $rpl_server_count is set, it configures that many servers. Only the second server is a slave; the rest are not part of the replication topology. mysql-test/include/mtr_check.sql: Removed unneeded SP (use include/force_restart.inc instead) mysql-test/include/mysqldump.inc: diff_tables.inc now takes only one parameter. mysql-test/include/ndb_master-slave.inc: use master-slave.inc instead of ad-hoc calls to 'connect' mysql-test/include/ndb_master-slave_2ch.inc: use rpl_init.inc instead of ad-hoc setup mysql-test/include/ndb_not_readonly.inc: turn off query log while executing this script. this was previously done by the caller. now it's done in the script. mysql-test/include/report-features.test: add newline at end of file mysql-test/include/reset_master_and_slave.inc: rpl_reset.inc replaces this file mysql-test/include/restart_mysqld.inc: force caller to use rpl_restart_server.inc instead if replication is configured mysql-test/include/rpl_change_topology.inc: New file to change replication topology on the fly. This is used by rpl_init.inc internally, but is also used by test cases that need to change topology (e.g., rpl.rpl_circular_for_4_hosts, which reconfigures the topology to make a failover). mysql-test/include/rpl_connect.inc: New file to create a named connection. This file knows about a number of "standard" connections (master, slave, server_1, etc), and knows how each of them should normally be created. This is mostly used internally (e.g., by rpl_init.inc, master-slave.inc, ndb_master-slave_2ch.inc etc), but can also be used by tests that need to bring a connection up after disconnecting. mysql-test/include/rpl_connection.inc: New file to change connection. This prints the name of the connection. However, for files that source rpl_begin_include_file.inc, it does not print the name of the connection unless $rpl_debug=1. This is good because printing something every time the .inc file changed connection would make the result log harder to read. mysql-test/include/rpl_diff.inc: - Made file capable to compare many servers - Hence renamed it to rpl_diff.inc - If no server list is specified, use all servers from server_1 to server_$rpl_server_count - It now writes the statement to file before executing it. That means it will be subject to SQL string interpolation, but not shell string interpolation (which may be platform-dependent) mysql-test/include/rpl_diff_tables.inc: Removed this file, since its functionality has been merged into diff_tables.inc. mysql-test/include/rpl_end.inc: Renamed master-slave-end.inc to rpl_end.inc, and made it work with arbitrary replication topologies (as configured with rpl_init.inc and possibly rpl_change_topology.inc). Also made it assert that no slave thread has an error. Made it assert that no slave thread is stopped, unless $rpl_only_running_threads=1. mysql-test/include/rpl_for_each_slave.inc: New test script that executes a command once for each slave. This is used by include/rpl_start_slaves.inc and include/rpl_stop_slaves.inc and could possibly be useful for other custom scripts too. mysql-test/include/rpl_generate_sync_chain.inc: New file that computes the variable $rpl_sync_chain. This variable determines in what order slaves are synced by include/rpl_sync.inc. The variable is recomputed the first time that include/rpl_sync.inc is called after rpl_change_topology.inc. mysql-test/include/rpl_init.inc: Made file work for arbitrary topologies instead of just 4-server circle. This file is used by master-slave.inc, rpl_master-slave_2ch.inc etc, and also by tests that need other specific replication topologies. mysql-test/include/rpl_reconnect.inc: New auxiliary file that will reconnect many clients to a given server. All clients configured by rpl_init.inc will reconnect. mysql-test/include/rpl_reset.inc: Made file work for arbitrary replication topologies, check for errors, and sync all threads. Also removed 'drop table' because that has nothing to do with replication. mysql-test/include/rpl_restart_server.inc: New auxiliary file that restarts a server. mysql-test/include/rpl_start_server.inc: New auxiliary file that starts a server that has been shut down. mysql-test/include/rpl_start_slaves.inc: New auxiliary file to start all slaves configured by rpl_init.inc This is used internally by rpl_init.inc but may also be used by tests that want to bring all slaves up. mysql-test/include/rpl_stop_server.inc: New auxiliary file that shuts down a server. mysql-test/include/rpl_stop_slaves.inc: New auxiliary file to stop all slaves configured rpl_init.inc. This is used internally by rpl_end.inc, but may also be used by tests that want to stop all slaves. mysql-test/include/rpl_sync.inc: Made file work for arbitrary replication topologies (as configured by rpl_init.inc and possibly rpl_change_topology.inc) instead of just 4-server circle. mysql-test/include/save_master_pos.inc: Auxiliary file to save the master position. mysql-test/include/setup_fake_relay_log.inc: - Moved complicated logic to write to file into write_var_to_file.inc, so that it can be re-used by other tests. - Added call to show_rpl_debug_info and die in error case. mysql-test/include/show_rpl_debug_info.inc: - Made file print NOW() - Made file print both SHOW MASTER STATUS, SHOW SLAVE HOSTS, and SHOW SLAVE STATUS. - Made file print debug info for all servers configured by rpl_init.inc mysql-test/include/show_slave_status.inc: - Made file use echo instead of SELECT to print variables. - Improved comments. - Use variable names that are less likely to be used by other tests. mysql-test/include/start_slave.inc: - Made test use rpl_begin_include_file.inc to improve debug capabilities. - improved documentation mysql-test/include/stop_slave.inc: - Made script capable to detect which threads are running and stop only those. - Improved documentation mysql-test/include/stop_slave_io.inc: Added file to stop the slave IO thread. mysql-test/include/stop_slave_sql.inc: Added file to stop the slave SQL thread. mysql-test/include/sync_io_with_master.inc: Added file to sync the IO thread of the current connection, up to a previously saved position. mysql-test/include/sync_slave_io_with_master.inc: - Made file work with arbitrarily-named connections. - Made file use rpl_begin_include_file.inc to improve debug capabilities. mysql-test/include/sync_slave_sql_with_io.inc: Added file to sync only the SQL thread, up to the position copied in the IO thread. mysql-test/include/wait_for_query_to_fail.inc: Added file to wait for a query to fail. mysql-test/include/wait_for_slave_io_error.inc: - Use rpl_begin_include_file.inc to improve debug capabilities. - Use existing atom include/show_slave_status.inc to print error message. - Improve comments. ****** - This file now waits until the slave IO thread has completely stopped (to avoid races in tests). - Some IO thread errors are non-fatal and don't cause the slave IO thread to stop. To allow tests to wait for such errors, we add the parameters $slave_io_error_is_nonfatal. If $slave_io_error_is_nonfatal is set, this script does not wait for the IO thread to stop. mysql-test/include/wait_for_slave_io_to_start.inc: - Made script fail if the IO thread has an error. - Use rpl_begin_include_file.inc to improve debug capabilities. - Improved documentation. mysql-test/include/wait_for_slave_io_to_stop.inc: - Fail if server is not configured as slave. Previously, the script accepted servers not configured as slave because there was cleanup code called from master-slave.inc that would execute STOP SLAVE on both master and slave. Now all tests have to clean up after themselves, so we don't have to call stop slave at the beginning of tests. Hence, we disallow calling this script on servers not configured as slaves. - Use rpl_begin_include_file.inc to improve debug capabilities. - Improved documentation. mysql-test/include/wait_for_slave_param.inc: - Added $slave_error_param. This variable can be set to Slave_IO_Errno or Slave_SQL_Errno, in which case the script fails if the corresponding column in the output from SHOW SLAVE STATUS is nonzero. - Replaced exit by die. - Made it print timeout seconds correctly in error message. - Removed $slave_error_message. This is not needed. - Use rpl_begin_include_file.inc for better debug capabilities. mysql-test/include/wait_for_slave_sql_error.inc: - Use rpl_begin_include_file.inc for better debug capabilities. - Improve documentation - Use existing atom show_slave_status.inc to print error. mysql-test/include/wait_for_slave_sql_error_and_skip.inc: - Use rpl_begin_include_file.inc and rpl_connection.inc for better debug capabilities. - Improve documentation mysql-test/include/wait_for_slave_sql_to_start.inc: - Use rpl_begin_include_file.inc for better debug capabilities. - Improve documentation mysql-test/include/wait_for_slave_sql_to_stop.inc: - Fail if Last_SQL_Errno is nonzero. - Fail if server is not configured as slave. Previously, the script accepted servers not configured as slave because there was cleanup code called from master-slave.inc that would execute STOP SLAVE on both master and slave. Now all tests have to clean up after themselves, so we don't have to call stop slave at the beginning of tests. Hence, we disallow calling this script on servers not configured as slaves. - Use rpl_begin_include_file.inc for better debug capabilities. - Improve documentation mysql-test/include/wait_for_slave_to_start.inc: - Use rpl_begin_include_file.inc for better debug capabilities. - Improve documentation mysql-test/include/wait_for_slave_to_stop.inc: - Use rpl_begin_include_file.inc for better debug capabilities. - Improve documentation mysql-test/include/write_var_to_file.inc: Added file to write contents of a mysqltest variable to file. (This was previously in setup_fake_relay_log.inc) mysql-test/mysql-test-run.pl: Allow tests to require restart in case the test is skipped. mysql-test/r/init_file.result: updated result file mysql-test/r/mysqldump_restore.result: update result file mysql-test/suite/binlog/r/binlog_drop_if_exists.result: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/r/binlog_old_versions.result: updated result file mysql-test/suite/binlog/r/binlog_query_filter_rules.result: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/r/binlog_server_id.result: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/r/binlog_sf.result: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/r/binlog_sql_mode.result: updated result file mysql-test/suite/binlog/t/binlog_auto_increment_bug33029-master.opt: This test replicates, so it should be in the rpl suite. Then we can remove this .opt file too. mysql-test/suite/binlog/t/binlog_drop_if_exists.test: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/t/binlog_old_versions.test: cosmetic fixes mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/t/binlog_query_filter_rules.test: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/t/binlog_server_id.test: Moved test that does not use replication to binlog suite. mysql-test/suite/binlog/t/binlog_sf.test: Moved test that does not use replication to binlog suite. Since test sets binlog_format internally, it's useless to re-run it. Hence we source have_binlog_format_statement.inc mysql-test/suite/binlog/t/binlog_sql_mode.test: - Test does not use replication, so we remove master-slave.inc. - mysqltest magically adds --force-if-open to $MYSQL_BINLOG in test files that source master-slave.inc. So now we have to add --force-if-open explicitly. mysql-test/suite/bugs/t/rpl_bug12691.test: made test clean up after itself cosmetic fixes mysql-test/suite/bugs/t/rpl_bug23533.test: made test clean up after itself cosmetic fixes mysql-test/suite/bugs/t/rpl_bug31582.test: made test clean up after itself mysql-test/suite/bugs/t/rpl_bug31583.test: made test clean up after itself mysql-test/suite/bugs/t/rpl_bug33029.test: made test clean up after itself mysql-test/suite/bugs/t/rpl_bug36391.test: made test clean up after itself cosmetic fixes mysql-test/suite/bugs/t/rpl_bug37426.test: made test clean up after itself cosmetic fixes mysql-test/suite/bugs/t/rpl_bug38205.test: made test clean up after itself mysql-test/suite/manual/t/rpl_replication_delay.test: made test clean up after itself cosmetic fixes mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test: made test clean up after itself cosmetic fixes mysql-test/suite/ndb_team/t/rpl_ndb_extraColMaster.test: made test clean up after itself mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb.test: made test clean up after itself cosmetic fixes mysql-test/suite/parts/r/rpl_partition.result: updated result file mysql-test/suite/parts/t/rpl_partition.test: Make test clean up replication state. cosmetic fixes mysql-test/suite/rpl/include/rpl_mixed_ddl.inc: made test clean up after itself cosmetic fixes mysql-test/suite/rpl/include/rpl_mixed_dml.inc: made test clean up after itself cosmetic fixes mysql-test/suite/rpl/r/rpl_000010.result: update result file mysql-test/suite/rpl/r/rpl_000011.result: update result file mysql-test/suite/rpl/r/rpl_000013.result: update result file mysql-test/suite/rpl/r/rpl_000017.result: update result file mysql-test/suite/rpl/r/rpl_EE_err.result: update result file mysql-test/suite/rpl/r/rpl_LD_INFILE.result: update result file mysql-test/suite/rpl/r/rpl_alter.result: update result file mysql-test/suite/rpl/r/rpl_alter_db.result: update result file mysql-test/suite/rpl/r/rpl_auto_increment.result: update result file mysql-test/suite/rpl/r/rpl_auto_increment_11932.result: update result file mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result: update result file mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result: update result file mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result: update result file mysql-test/suite/rpl/r/rpl_binlog_corruption.result: Updated result file mysql-test/suite/rpl/r/rpl_binlog_errors.result: updated result file mysql-test/suite/rpl/r/rpl_binlog_grant.result: update result file mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result: Updated result file mysql-test/suite/rpl/r/rpl_bit.result: update result file mysql-test/suite/rpl/r/rpl_bit_npk.result: update result file mysql-test/suite/rpl/r/rpl_blackhole.result: update result file mysql-test/suite/rpl/r/rpl_bug26395.result: update result file mysql-test/suite/rpl/r/rpl_bug31076.result: update result file mysql-test/suite/rpl/r/rpl_bug33931.result: updated result file mysql-test/suite/rpl/r/rpl_bug38694.result: update result file mysql-test/suite/rpl/r/rpl_change_master.result: update result file mysql-test/suite/rpl/r/rpl_charset.result: update result file mysql-test/suite/rpl/r/rpl_charset_sjis.result: update result file mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result: Updated result file mysql-test/suite/rpl/r/rpl_colSize.result: update result file mysql-test/suite/rpl/r/rpl_commit_after_flush.result: update result file mysql-test/suite/rpl/r/rpl_concurrency_error.result: update result file mysql-test/suite/rpl/r/rpl_conditional_comments.result: update result file mysql-test/suite/rpl/r/rpl_create_database.result: update result file mysql-test/suite/rpl/r/rpl_create_if_not_exists.result: update result file mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result: update result file mysql-test/suite/rpl/r/rpl_cross_version.result: Updated result file mysql-test/suite/rpl/r/rpl_current_user.result: update result file mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: update result file mysql-test/suite/rpl/r/rpl_delete_no_where.result: update result file mysql-test/suite/rpl/r/rpl_do_grant.result: updated result file mysql-test/suite/rpl/r/rpl_drop.result: update result file mysql-test/suite/rpl/r/rpl_drop_db.result: update result file mysql-test/suite/rpl/r/rpl_drop_temp.result: update result file mysql-test/suite/rpl/r/rpl_drop_view.result: update result file mysql-test/suite/rpl/r/rpl_dual_pos_advance.result: update result file mysql-test/suite/rpl/r/rpl_empty_master_crash.result: update result file mysql-test/suite/rpl/r/rpl_err_ignoredtable.result: update result file mysql-test/suite/rpl/r/rpl_events.result: update result file mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result: update result file mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result: update result file mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result: update result file mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result: update result file mysql-test/suite/rpl/r/rpl_failed_optimize.result: update result file mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result: update result file mysql-test/suite/rpl/r/rpl_flushlog_loop.result: update result file mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result: update result file mysql-test/suite/rpl/r/rpl_found_rows.result: update result file mysql-test/suite/rpl/r/rpl_free_items.result: update result file mysql-test/suite/rpl/r/rpl_geometry.result: update result file mysql-test/suite/rpl/r/rpl_get_lock.result: update result file mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result: update result file mysql-test/suite/rpl/r/rpl_grant.result: update result file mysql-test/suite/rpl/r/rpl_idempotency.result: update result file mysql-test/suite/rpl/r/rpl_ignore_grant.result: update result file mysql-test/suite/rpl/r/rpl_ignore_revoke.result: update result file mysql-test/suite/rpl/r/rpl_ignore_table.result: update result file mysql-test/suite/rpl/r/rpl_ignore_table_update.result: update result file mysql-test/suite/rpl/r/rpl_incident.result: update result file mysql-test/suite/rpl/r/rpl_init_slave.result: update result file mysql-test/suite/rpl/r/rpl_init_slave_errors.result: update result file mysql-test/suite/rpl/r/rpl_innodb.result: update result file mysql-test/suite/rpl/r/rpl_innodb_bug28430.result: update result file mysql-test/suite/rpl/r/rpl_innodb_bug30888.result: update result file mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result: update result file mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result: update result file mysql-test/suite/rpl/r/rpl_insert.result: update result file mysql-test/suite/rpl/r/rpl_insert_id.result: update result file mysql-test/suite/rpl/r/rpl_insert_id_pk.result: update result file mysql-test/suite/rpl/r/rpl_insert_ignore.result: update result file mysql-test/suite/rpl/r/rpl_insert_select.result: update result file mysql-test/suite/rpl/r/rpl_invoked_features.result: update result file mysql-test/suite/rpl/r/rpl_killed_ddl.result: update result file mysql-test/suite/rpl/r/rpl_known_bugs_detection.result: update result file mysql-test/suite/rpl/r/rpl_load_from_master.result: update result file mysql-test/suite/rpl/r/rpl_load_table_from_master.result: update result file mysql-test/suite/rpl/r/rpl_loaddata.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_charset.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_fatal.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_m.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_map.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_s.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_simple.result: update result file mysql-test/suite/rpl/r/rpl_loaddata_symlink.result: update result file mysql-test/suite/rpl/r/rpl_loaddatalocal.result: update result file mysql-test/suite/rpl/r/rpl_loadfile.result: update result file mysql-test/suite/rpl/r/rpl_locale.result: update result file mysql-test/suite/rpl/r/rpl_log_pos.result: update result file mysql-test/suite/rpl/r/rpl_manual_change_index_file.result: update result file mysql-test/suite/rpl/r/rpl_many_optimize.result: update result file mysql-test/suite/rpl/r/rpl_master_pos_wait.result: update result file mysql-test/suite/rpl/r/rpl_misc_functions.result: update result file mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result: update result file mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result: update result file mysql-test/suite/rpl/r/rpl_multi_delete.result: update result file mysql-test/suite/rpl/r/rpl_multi_delete2.result: update result file mysql-test/suite/rpl/r/rpl_multi_engine.result: update result file mysql-test/suite/rpl/r/rpl_multi_update.result: update result file mysql-test/suite/rpl/r/rpl_multi_update2.result: update result file mysql-test/suite/rpl/r/rpl_multi_update3.result: update result file mysql-test/suite/rpl/r/rpl_multi_update4.result: update result file mysql-test/suite/rpl/r/rpl_mysql_upgrade.result: update result file mysql-test/suite/rpl/r/rpl_name_const.result: update result file mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result: update result file mysql-test/suite/rpl/r/rpl_not_null_innodb.result: update result file mysql-test/suite/rpl/r/rpl_not_null_myisam.result: update result file mysql-test/suite/rpl/r/rpl_optimize.result: update result file mysql-test/suite/rpl/r/rpl_packet.result: update result file mysql-test/suite/rpl/r/rpl_plugin_load.result: update result file mysql-test/suite/rpl/r/rpl_ps.result: update result file mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result: update result file mysql-test/suite/rpl/r/rpl_read_only.result: update result file mysql-test/suite/rpl/r/rpl_relay_space_innodb.result: update result file mysql-test/suite/rpl/r/rpl_relay_space_myisam.result: update result file mysql-test/suite/rpl/r/rpl_relayrotate.result: update result file mysql-test/suite/rpl/r/rpl_relayspace.result: update result file mysql-test/suite/rpl/r/rpl_replicate_do.result: update result file mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result: update result file mysql-test/suite/rpl/r/rpl_report.result: update result file mysql-test/suite/rpl/r/rpl_rewrt_db.result: update result file mysql-test/suite/rpl/r/rpl_rotate_logs.result: update result file mysql-test/suite/rpl/r/rpl_row_001.result: update result file mysql-test/suite/rpl/r/rpl_row_4_bytes.result: update result file mysql-test/suite/rpl/r/rpl_row_NOW.result: update result file mysql-test/suite/rpl/r/rpl_row_USER.result: update result file mysql-test/suite/rpl/r/rpl_row_UUID.result: update result file mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result: update result file mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result: update result file mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_basic_8partition.result: update result file mysql-test/suite/rpl/r/rpl_row_blob_innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_blob_myisam.result: update result file mysql-test/suite/rpl/r/rpl_row_colSize.result: update result file mysql-test/suite/rpl/r/rpl_row_conflicts.result: update result file mysql-test/suite/rpl/r/rpl_row_delayed_ins.result: update result file mysql-test/suite/rpl/r/rpl_row_drop.result: update result file mysql-test/suite/rpl/r/rpl_row_find_row.result: update result file mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result: update result file mysql-test/suite/rpl/r/rpl_row_func001.result: update result file mysql-test/suite/rpl/r/rpl_row_func002.result: update result file mysql-test/suite/rpl/r/rpl_row_func003.result: update result file mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result: updated result file mysql-test/suite/rpl/r/rpl_row_insert_delayed.result: update result file mysql-test/suite/rpl/r/rpl_row_log.result: update result file mysql-test/suite/rpl/r/rpl_row_log_innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: update result file mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result: update result file mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result: update result file mysql-test/suite/rpl/r/rpl_row_reset_slave.result: update result file mysql-test/suite/rpl/r/rpl_row_sp001.result: update result file mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_sp003.result: update result file mysql-test/suite/rpl/r/rpl_row_sp005.result: update result file mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result: update result file mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_sp008.result: update result file mysql-test/suite/rpl/r/rpl_row_sp009.result: update result file mysql-test/suite/rpl/r/rpl_row_sp010.result: update result file mysql-test/suite/rpl/r/rpl_row_sp011.result: update result file mysql-test/suite/rpl/r/rpl_row_sp012.result: update result file mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result: update result file mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result: update result file mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result: update result file mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result: update result file mysql-test/suite/rpl/r/rpl_row_trig001.result: update result file mysql-test/suite/rpl/r/rpl_row_trig002.result: update result file mysql-test/suite/rpl/r/rpl_row_trig003.result: update result file mysql-test/suite/rpl/r/rpl_row_trig004.result: update result file mysql-test/suite/rpl/r/rpl_row_trunc_temp.result: update result file mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result: update result file mysql-test/suite/rpl/r/rpl_row_until.result: update result file mysql-test/suite/rpl/r/rpl_row_view01.result: update result file mysql-test/suite/rpl/r/rpl_row_wide_table.result: update result file mysql-test/suite/rpl/r/rpl_server_id1.result: update result file mysql-test/suite/rpl/r/rpl_server_id2.result: update result file mysql-test/suite/rpl/r/rpl_session_var.result: update result file mysql-test/suite/rpl/r/rpl_set_charset.result: update result file mysql-test/suite/rpl/r/rpl_set_null_innodb.result: update result file mysql-test/suite/rpl/r/rpl_set_null_myisam.result: update result file mysql-test/suite/rpl/r/rpl_show_slave_running.result: update result file mysql-test/suite/rpl/r/rpl_skip_error.result: update result file mysql-test/suite/rpl/r/rpl_slave_grp_exec.result: update result file mysql-test/suite/rpl/r/rpl_slave_load_in.result: update result file mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result: Updated result file mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result: updated result file mysql-test/suite/rpl/r/rpl_slave_skip.result: update result file mysql-test/suite/rpl/r/rpl_slave_status.result: update result file mysql-test/suite/rpl/r/rpl_slow_query_log.result: update result file mysql-test/suite/rpl/r/rpl_sp.result: update result file mysql-test/suite/rpl/r/rpl_sp004.result: update result file mysql-test/suite/rpl/r/rpl_sp_effects.result: update result file mysql-test/suite/rpl/r/rpl_sporadic_master.result: update result file mysql-test/suite/rpl/r/rpl_ssl.result: update result file mysql-test/suite/rpl/r/rpl_ssl1.result: update result file mysql-test/suite/rpl/r/rpl_start_stop_slave.result: update result file mysql-test/suite/rpl/r/rpl_stm_000001.result: update result file mysql-test/suite/rpl/r/rpl_stm_EE_err2.result: updated result file mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result: update result file mysql-test/suite/rpl/r/rpl_stm_binlog_direct.result: update result file mysql-test/suite/rpl/r/rpl_stm_conflicts.result: update result file mysql-test/suite/rpl/r/rpl_stm_create_if_not_exists.result: update result file mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result: update result file mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result: update result file mysql-test/suite/rpl/r/rpl_stm_loadfile.result: update result file mysql-test/suite/rpl/r/rpl_stm_log.result: update result file mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: update result file mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result: update result file mysql-test/suite/rpl/r/rpl_stm_multi_query.result: update result file mysql-test/suite/rpl/r/rpl_stm_no_op.result: update result file mysql-test/suite/rpl/r/rpl_stm_reset_slave.result: update result file mysql-test/suite/rpl/r/rpl_stm_sql_mode.result: update result file mysql-test/suite/rpl/r/rpl_stm_until.result: update result file mysql-test/suite/rpl/r/rpl_stop_slave.result: update result file mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result: update result file mysql-test/suite/rpl/r/rpl_temp_table.result: update result file mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result: update result file mysql-test/suite/rpl/r/rpl_temporary.result: update result file mysql-test/suite/rpl/r/rpl_temporary_errors.result: update result file mysql-test/suite/rpl/r/rpl_test_framework.result: updated result file mysql-test/suite/rpl/r/rpl_timezone.result: Updated result file mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result: update result file mysql-test/suite/rpl/r/rpl_trigger.result: update result file mysql-test/suite/rpl/r/rpl_trunc_temp.result: update result file mysql-test/suite/rpl/r/rpl_truncate_2myisam.result: update result file mysql-test/suite/rpl/r/rpl_truncate_3innodb.result: update result file mysql-test/suite/rpl/r/rpl_typeconv_innodb.result: update result file mysql-test/suite/rpl/r/rpl_udf.result: update result file mysql-test/suite/rpl/r/rpl_user.result: update result file mysql-test/suite/rpl/r/rpl_user_variables.result: update result file mysql-test/suite/rpl/r/rpl_variables.result: update result file mysql-test/suite/rpl/r/rpl_variables_stm.result: update result file mysql-test/suite/rpl/r/rpl_view.result: update result file mysql-test/suite/rpl/t/rpl000017-slave.sh: Moved contents of -slave.sh into test. mysql-test/suite/rpl/t/rpl_000010-slave.opt: make all rpl tests use prefix rpl_ mysql-test/suite/rpl/t/rpl_000010.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_000011.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_000013.test: Made test clean up replication state. Replaced save_master_pos/connection slave/sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_000017-slave.opt: make all rpl tests use prefix rpl_ mysql-test/suite/rpl/t/rpl_000017.test: Moved contents of -slave.sh into .test Made test clean up replication state. mysql-test/suite/rpl/t/rpl_EE_err.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_LD_INFILE.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_alter.test: made test clean up after itself replaced rpl_diff_tables by diff_tables cosmetic fixes mysql-test/suite/rpl/t/rpl_alter_db.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_auto_increment.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_auto_increment_11932.test: Made test clean up replication state. don't drop database twice mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test: - This test replicates, so moved it to rpl suite. - This test uses a fake relay log, so use include/setup_fake_relay_log.inc and cleanup_fake_relay_log.inc instead of ad-hoc code. - Made test clean up replication state (rpl_end.inc) mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test: - Made test clean up replication state. - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test: renamed rpl_end.inc to master-slave-end.inc mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt: Got rid of useless -master.opt file. mysql-test/suite/rpl/t/rpl_binlog_corruption.test: Made test clean up replication state. Made test execute on slave connection instead of on master connection. This allows us to get rid of -master.opt file. mysql-test/suite/rpl/t/rpl_binlog_errors.test: made test use rpl_restart_server.inc instead of restart_mysqld.inc mysql-test/suite/rpl/t/rpl_binlog_grant.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test: - Made test clean up replication state. - replaced wait_for_slave_sql_to_stop.inc by wait_for_slave_sql_error_and_skip.inc - renamed diff_master_slave.inc to rpl_diff.inc and renamed $diff_statement to $rpl_diff_statement mysql-test/suite/rpl/t/rpl_bit.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_bit_npk.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_blackhole.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_bug26395.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_bug31076.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_bug33931.test: Made test clean up replication state. Made test use source include/master-slave.inc instead of ad-hoc setup. mysql-test/suite/rpl/t/rpl_bug38694.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_change_master.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_charset.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_charset_sjis.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf: Use new names of mtr variables (introduced by the changes in include/circular_rpl_init.inc). mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test: - Use rpl_init.inc instead of circular_rpl_for_4_hosts.inc. Connections have been renamed (server_[1234] instead of master_[abcd]), we use rpl_sync.inc instead of circular_rpl_for_4_hosts_sync.inc, we use the new rpl_end.inc to clean up instead of doing it manually, and we use rpl_change_topology.inc instead of manual reconfiguration. - Added comment to make test understandable. - the test contained a race condition. server_4 was not sync'ed. This could cause sql_slave_skip_counter to have the value 1 when the test ended, so check-testcase would complain. Added 'sync_slave_with_master server_4'. mysql-test/suite/rpl/t/rpl_colSize.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_commit_after_flush.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_concurrency_error.test: - Made test clean up replication state. - renamed diff_master_slave.inc to rpl_diff.inc and renamed $diff_statement to $rpl_diff_statement mysql-test/suite/rpl/t/rpl_conditional_comments.test: made test clean up after itself new protocol for diff_tables.inc mysql-test/suite/rpl/t/rpl_create_database.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_create_if_not_exists.test: renamed master-slave-end.inc to rpl_end.inc mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test: renamed master-slave-end.inc to rpl_end.inc mysql-test/suite/rpl/t/rpl_critical_errors.test: Made test clean up replication state. Fixed syntax error in test. mysql-test/suite/rpl/t/rpl_cross_version.test: Made test clean up replication state. Made test execute on slave connection instead of on master connection. This allows us to get rid of -master.opt file. mysql-test/suite/rpl/t/rpl_current_user.cnf: use environment variables recognized by rpl_init.inc mysql-test/suite/rpl/t/rpl_current_user.test: - Use rpl_init.inc instead of ad-hoc three-server setup. Hence, rename connection slave2 to server_3 - don't drop lots of things at the beginning of the test - rpl_diff_tables.inc does not sync any more, so we have to sync here instead - renamed $diff_table to $rpl_diff_table and $diff_table_list to $rpl_diff_table_list - use diff_tables.inc instead of rpl_diff_tables.inc mysql-test/suite/rpl/t/rpl_ddl.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_deadlock_innodb.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_delete_no_where.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_do_grant.test: Made test clean up replication state. renamed master-slave-end.inc to rpl_end.inc use include/check_slave_no_error.inc instead of ad-hoc construction mysql-test/suite/rpl/t/rpl_drop.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_drop_db.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_drop_temp.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_drop_view.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Made test use the new framework for circular replication, instead of ad-hoc setup. mysql-test/suite/rpl/t/rpl_empty_master_crash.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_err_ignoredtable.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_events.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_failed_optimize.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test: renamed master-slave-end.inc to rpl_end.inc mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt: Removed useless options from -master.opt file. mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh: Removed useless -master.sh file mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt: Removed useless options from -slave.opt file mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh: Removed useless -slave.sh file mysql-test/suite/rpl/t/rpl_flushlog_loop.test: Made test use new framework for circular replication, instead of ad-hoc setup. Made test clean up replication state. mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_found_rows.test: Made test clean up replication state. replaced reset_master_and_slave.inc by rpl_reset.inc mysql-test/suite/rpl/t/rpl_free_items.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_geometry.test: replaced master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_get_lock.test: Made test clean up replication state. Replaced save_master_pos+connection slave+sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test: Made test clean up replication state. Removed last part of test, because it was verbatim identical to rpl_server_id1.test mysql-test/suite/rpl/t/rpl_grant.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_idempotency.test: use check_slave_no_error.inc instead of ad-hoc tests use wait_for_slave_sql_error.inc instead of wait_for_slave_to_stop.inc replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_ignore_grant.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_ignore_revoke.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_ignore_table.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_ignore_table_update.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_incident.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_init_slave.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_init_slave_errors.test: Made test clean up replication state. Also replaced call to wait_for_slave_sql_to_stop.inc by call to wait_for_slave_sql_error.inc mysql-test/suite/rpl/t/rpl_innodb.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_innodb_bug28430.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_innodb_bug30888.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_insert.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_insert_id.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_insert_id_pk.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_insert_ignore.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_insert_select.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_invoked_features.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_killed_ddl.test: - Made test clean up replication state. - renamed diff_master_slave.inc to rpl_diff.inc and renamed $diff_statement to $rpl_diff_statement mysql-test/suite/rpl/t/rpl_known_bugs_detection.test: - Made test clean up replication state. - removed wait_for_slave_sql_to_stop.inc, because it already does wait_for_slave_sql_error.inc mysql-test/suite/rpl/t/rpl_load_from_master.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_load_table_from_master.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_loaddata_charset.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata_fatal.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata_m.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata_map.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata_s.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata_simple.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddata_symlink.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loaddatalocal.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_loadfile.test: - Made test clean up replication state. - replace reset_master_and_slave.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. - diff_tables.inc also restores the connection to what it was before, so in this test we have to manually change connection after sourcing diff_tables.inc mysql-test/suite/rpl/t/rpl_locale.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_log_pos.test: Made test clean up replication state. replace stop_slave.inc by stop_slave_sql.inc since the io thread is already stopped. mysql-test/suite/rpl/t/rpl_manual_change_index_file.test: use wait_for_slave_io_error.inc instead of wait_for_slave_to_stop.inc replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_many_optimize.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_master_pos_wait.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_misc_functions.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_multi_delete.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_multi_delete2.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_multi_engine.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_multi_update.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_multi_update2.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_multi_update3.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_multi_update4.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_mysql_upgrade.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_name_const.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test: - Made test clean up replication state. - diff_tables.inc now takes only one parameter. - diff_tables.inc also restores the connection to what it was before, so in this test we have to manually change connection after sourcing diff_tables.inc mysql-test/suite/rpl/t/rpl_not_null_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_not_null_myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_optimize.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_packet.test: - Made test clean up replication state. - replace wait_for_slave_io_to_stop.inc by wait_for_slave_io_error.inc - replace master-slave-reset.inc by rpl_reset.inc + drop table t1. - replaced save_master_pos/connection slave/sync_with_master by sync_slave_with_master. - added comment explaining why we need stop_slave_sql.inc (we shouldn't need it, it's a bug) mysql-test/suite/rpl/t/rpl_plugin_load.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_ps.test: Made test clean up replication state. removed lots os useless junk mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_read_only.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_relay_space_innodb.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_relay_space_myisam.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_relayrotate.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_relayspace.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_replicate_do.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_report.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_rewrt_db.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt: Got rid of unnecessary -slave.opt file mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh: Got rid of unnecessary -slave.sh file mysql-test/suite/rpl/t/rpl_rotate_logs.test: - Made test clean up replication state. - replaced wait_for_slave_sql_to_stop.inc by wait_for_slave_sql_error_and_skip.inc - removed useless cleanup at beginning of test - did not make test use the standard replication framework (master-slave.inc + rpl_end.inc), because it won't work. i don't know why. mysql-test/suite/rpl/t/rpl_row_001.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_4_bytes.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_NOW.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_USER.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_UUID.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test: Made test clean up replication state. Removed unnecessary 'set binlog_format'. replaced master-slave-reset.inc by rpl_reset.inc mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_basic_8partition.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_blob_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_blob_myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_colSize.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_conflicts.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_row_create_table.test: replace master-slave-end.inc by rpl_end.inc replace master-slave-reset.inc by rpl_reset.inc replace long sequence of reset master+reset slave by rpl_reset.inc mysql-test/suite/rpl/t/rpl_row_delayed_ins.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_row_drop.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_find_row.test: - Made test clean up replication state. - replace master-slave-reset.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_row_func001.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_func002.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_func003.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test: Made test clean up replication state. replace wait_for_slave_sql_to_stop.inc by wait_for_slave_sql_error.inc mysql-test/suite/rpl/t/rpl_row_insert_delayed.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_log.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_log_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test: Made test clean up replication state mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test: - replace master-slave-reset.inc by rpl_reset.inc - Made test clean up replication state - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_row_sp001.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_row_sp003.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp005.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_row_sp008.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp009.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp010.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp011.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_sp012.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test: - replaced master-slave-reset.inc by rpl_reset.inc - replaced master-slave-end.inc by rpl_end.inc - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_row_trig001.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_trig002.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_trig003.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_trig004.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_trunc_temp.test: replaced master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_until.test: Made test clean up replication state. Removed unused mtr variable $VERSION. mysql-test/suite/rpl/t/rpl_row_view01.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_row_wide_table.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_server_id1.test: - Replaced ad-hoc setup of circular replication by call to rpl_init.inc - Made test clean up replication state. - Replaced ad-hoc use of wait_for_slave_param.inc by wait_for_slave_io_error.inc mysql-test/suite/rpl/t/rpl_server_id2.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_session_var.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_set_charset.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_set_null_innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_set_null_myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_show_slave_running.test: made test clean up replication state mysql-test/suite/rpl/t/rpl_skip_error.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_slave_grp_exec.test: - Made test clean up replication state. - replaced wait_for_slave_sql_to_stop.inc by wait_for_slave_sql_error.inc - replaced stop_slave.inc by stop_slave_io.inc where the sql thread was already stopped. mysql-test/suite/rpl/t/rpl_slave_load_in.test: - Made test clean up replication state. - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test: - Made test clean up replication state. - Replaced call to wait_for_slave_sql_to_stop.inc by call to wait_for_slave_sql_error.inc - Replaced ad-hoc repliction setup by call to master-slave.inc mysql-test/suite/rpl/t/rpl_slave_skip.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_slave_status.test: Made test clean up replication state. replaced check that IO thread has stopped by wait_for_slave_io_error.inc simplified cleanup code mysql-test/suite/rpl/t/rpl_slow_query_log.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_sp.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_sp004.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_sp_effects.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_sporadic_master.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_ssl.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_ssl1.test: Made test clean up replication state. Replaced save_master_pos+connection slave+sync_slave_with_master by sync_slave_with_master mysql-test/suite/rpl/t/rpl_start_stop_slave.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_000001.test: The include file extra/rpl_tests/rpl_stm_000001.test was only sourced once, in suite/rpl/t/rpl_stm_000001.test. Moved extra/rpl_tests/rpl_stm_000001.test to suite/rpl/t/rpl_stm_000001.test and removed the old suite/rpl/t/rpl_stm_000001.test. Also made test clean up replication state, and replaced wait_for_slave_sql_to_stop.inc by wait_for_slave_sql_error_and_skip.inc mysql-test/suite/rpl/t/rpl_stm_000001.test: - The include file extra/rpl_tests/rpl_stm_000001.test was only sourced once, in suite/rpl/t/rpl_stm_000001.test. Moved extra/rpl_tests/rpl_stm_000001.test to suite/rpl/t/rpl_stm_000001.test and removed the old suite/rpl/t/rpl_stm_000001.test. mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_binlog_direct.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_conflicts.test: replaced master-slave-end.inc by rpl_end.inc cosmetic fixes mysql-test/suite/rpl/t/rpl_stm_create_if_not_exists.test: use rpl_end instead of master-slave-end. mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_loadfile.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_log.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test: - replaced master-slave-end.inc by rpl_end.inc - replaced master-slave-reset.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_stm_multi_query.test: cosmetic fixes mysql-test/suite/rpl/t/rpl_stm_no_op.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_stm_sql_mode.test: made test clean up replication state mysql-test/suite/rpl/t/rpl_stm_until.test: - Made test clean up replication state. - replaced master-slave-reset.inc by rpl_reset.inc - the relay log is now called slave-relay-bin.000003 instead of .000004, because master-slave.inc doesn't rotate it as much as before. mysql-test/suite/rpl/t/rpl_stop_slave.test: use rpl_end instead of master-slav-end mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_temp_table.test: Made test clean up replication state. Replaced save_master_pos/connection slave/sync_with_master by sync_slave_with_master. mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test: Made test clean up replication state. replaced ad-hoc call to 'connect' by include/rpl_connect.inc replaced master-slave-reset.inc by rpl_reset.inc mysql-test/suite/rpl/t/rpl_temporary.test: - Made test clean up replication state. - This test sources include/delete_anonymous_users.inc on master. This means it updates the user table in the mysql database manually on the master. This causes failure in the slave sql thread when binlog_format=row. Hence, we stop the slave first and source include/delete_anonymous_users.inc on both master and slave. mysql-test/suite/rpl/t/rpl_temporary_errors.test: Made test clean up replication state. cosmetic fixes mysql-test/suite/rpl/t/rpl_test_framework.cnf: new cfg file for new test mysql-test/suite/rpl/t/rpl_test_framework.test: new test case that verifies that include/rpl_change_topology.inc works mysql-test/suite/rpl/t/rpl_timezone.test: - Made test clean up replication state. - stop slave before last sub-test, because that test does not use the slave connection. mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_trigger.test: - Made test clean up replication state. - replace master-slave-reset.inc by rpl_reset.inc - use new file rpl_reconnect.inc instead of ad-hoc code - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_trunc_temp.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_truncate_2myisam.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_truncate_3innodb.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_typeconv_innodb.test: - made test clean up replication state - removed unnecessary call to master-slave-reset.inc - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_udf.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_user.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_user_variables.test: Made test clean up replication state. mysql-test/suite/rpl/t/rpl_variables.test: - Made test clean up replication state. - replaced reset_master_and_slave.inc by rpl_reset.inc - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_variables_stm.test: - Made test clean up replication state. - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl/t/rpl_view.test: Made test clean up replication state. mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result: updated result file mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: - replaced master-slave-end.inc by rpl_end.inc - removed wait_for_slave_sql_to_stop since it is followed by wait_for_slave_sql_error.inc mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test: made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test: made test use rpl_init.inc to setup circular replication, instead of ad-hoc setup made test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf: removed automatic configuration of server as slave. this is not needed because rpl_init.inc does it. mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test: - made test clean up replication state - it seems that sync_slave_with_master does not work deterministically here, so instead we wait for 'drop table' to replicate by checking when the table disappears on slave. - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test: make test clean up replication state use rpl_change_topology.inc to reconfigure replication topology, instead of ad-hoc call to change master mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test: - replace master-slave-end.inc by rpl_end.inc - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test: - make test clean up replication state - diff_tables.inc now takes only one parameter. mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test: - make test clean up replication state - use rpl_change_topology.inc to change replication topology, instead of ad-hoc calls to change master mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test: make test clean up replication state mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test: replace master-slave-end.inc by rpl_end.inc mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test: make test clean up replication state mysql-test/suite/sys_vars/t/rpl_init_slave_func.test: made test clean up after itself mysql-test/t/init_file.test: use new file force_restart.inc instead of SP
Diffstat (limited to 'mysql-test/extra/rpl_tests')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_EE_err.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test26
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_charset.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_commit_after_flush.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_conflicts.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ddl.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_deadlock.test1
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_master.test (renamed from mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test)22
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_slave.test (renamed from mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test)33
-rw-r--r--mysql-test/extra/rpl_tests/rpl_failed_optimize.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_flsh_tbls.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_foreign_key.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test42
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id.test28
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id_pk.test20
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test62
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_max_relay_size.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_query.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update.test7
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_not_null.test14
-rw-r--r--mysql-test/extra/rpl_tests/rpl_record_compare.test15
-rw-r--r--mysql-test/extra/rpl_tests/rpl_reset_slave.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_UUID.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_basic.test60
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp002.test56
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp007.test25
-rw-r--r--mysql-test/extra/rpl_tests/rpl_set_null.test16
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test131
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test73
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stop_slave.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_sv_relay_space.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_test_framework.inc86
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate.test7
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate_helper.test8
41 files changed, 307 insertions, 549 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_EE_err.test b/mysql-test/extra/rpl_tests/rpl_EE_err.test
index 205bbe79dac..0b3fec1f605 100644
--- a/mysql-test/extra/rpl_tests/rpl_EE_err.test
+++ b/mysql-test/extra/rpl_tests/rpl_EE_err.test
@@ -9,10 +9,6 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
####################################
-# Change Author: JBM
-# Change Date: 2006-01-11
-# Change: Split test per lars review
-####################################
#"REQUIREMENT: A master DROP TABLE on a table with non-existing MYI
# file must be correctly replicated to the slave"
####################################
@@ -23,8 +19,5 @@ flush tables;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index abf3b4ec676..d81ab15a945 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -1,14 +1,6 @@
#
# Test of auto_increment with offset
#
-#####################################
-# By: JBM
-# Date: 2006-02-10
-# Change: NDB does not support auto inc
-# in this usage. Currently there is no
-# plan to implment. Skipping test when
-# NDB is default engine.
-#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
@@ -169,7 +161,7 @@ drop table t1;
# auto_increment fields if the values of them are 0. There is an inconsistency
# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat
#
-source include/master-slave-reset.inc;
+source include/rpl_reset.inc;
connection master;
--disable_warnings
@@ -210,12 +202,10 @@ INSERT INTO t2 VALUES(4);
FLUSH LOGS;
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;
connection master;
@@ -228,16 +218,16 @@ let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL test
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;
# End cleanup
+--connection master
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test b/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test
index 0bfa46de113..30b25955ecb 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test
@@ -29,8 +29,7 @@ commit;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
-let $diff_table_1=master:test.t3;
-let $diff_table_2=slave:test.t3;
+let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test b/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test
index 614d79d9c2d..f93d435349f 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test
@@ -60,14 +60,11 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INVOKES A TRIGGER with $trigger_action action'
-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;
-let $diff_table_1=master:test.t4;
-let $diff_table_2=slave:test.t4;
+let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t6;
-let $diff_table_2=slave:test.t6;
+let $diff_tables= master:t6, slave:t6;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test b/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test
index fece19b397d..d7c26ea42f1 100644
--- a/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test
+++ b/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test
@@ -41,11 +41,9 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action'
-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;
-let $diff_table_1=master:test.t3;
-let $diff_table_2=slave:test.t3;
+let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_charset.test b/mysql-test/extra/rpl_tests/rpl_charset.test
index 8bcb60b0227..e56642cbcb5 100644
--- a/mysql-test/extra/rpl_tests/rpl_charset.test
+++ b/mysql-test/extra/rpl_tests/rpl_charset.test
@@ -2,11 +2,7 @@
# This test will fail if the server/client does not support enough charsets.
source include/master-slave.inc;
---disable_warnings
set timestamp=1000000000;
-drop database if exists mysqltest2;
-drop database if exists mysqltest3;
---enable_warnings
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
@@ -151,6 +147,6 @@ eval create table `t1` (
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
-sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
index 98638b0b1f6..7de4f421c35 100644
--- a/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
+++ b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
@@ -1,16 +1,10 @@
-#################################
-# Test updated to use a wrapper #
-#################################
-
eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
begin;
insert into t1 values(1);
flush tables with read lock;
commit;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# cleanup
connection master;
unlock tables;
diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test
index 8a98059b0ad..943d254736d 100644
--- a/mysql-test/extra/rpl_tests/rpl_conflicts.test
+++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test
@@ -139,8 +139,13 @@ if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRIC
--echo ---- Wait until slave stops with an error ----
let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
source include/wait_for_slave_sql_error.inc;
- let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
- --echo Last_SQL_Error = $err (expected "can't find record" error)
+
+ --let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+ --replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
+ --disable_query_log
+ --eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
+ --enable_query_log
+
SELECT * FROM t1;
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
@@ -165,4 +170,4 @@ connection master;
DROP TABLE t1;
--echo [on slave]
-sync_slave_with_master;
+--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test
index f1064dc268f..3b0348cc29f 100644
--- a/mysql-test/extra/rpl_tests/rpl_ddl.test
+++ b/mysql-test/extra/rpl_tests/rpl_ddl.test
@@ -136,14 +136,6 @@ sync_slave_with_master;
connection master;
SET AUTOCOMMIT = 1;
#
-# 1. DROP all objects, which probably already exist, but must be created here
-#
---disable_warnings
-DROP DATABASE IF EXISTS mysqltest1;
-DROP DATABASE IF EXISTS mysqltest2;
-DROP DATABASE IF EXISTS mysqltest3;
---enable_warnings
-#
# 2. CREATE all objects needed
# working database is mysqltest1
# working table (transactional!) is mysqltest1.t1
@@ -619,6 +611,3 @@ connection master;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
---enable_warnings
-
--- source include/master-slave-end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test
index 607348ae97b..bd446c86943 100644
--- a/mysql-test/extra/rpl_tests/rpl_deadlock.test
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test
@@ -131,3 +131,4 @@ sync_slave_with_master;
SET global max_relay_log_size= @my_max_relay_log_size;
--echo End of 5.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
index 16c4bc8e2da..eb50149655e 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
@@ -1,24 +1,7 @@
#############################################################
-# Author: Chuck
-#############################################################
# Purpose: To test having extra columns on the master WL#3915
# engine inspecific sourced part
#############################################################
-# Change Author: Jeb
-# Change: Cleanup and extend testing
-#############################################################
-# TODO: partition specific
-# -- source include/have_partition.inc
-# Note: Will be done in different test due to NDB using this
-# test case.
-############################################################
-
-########### Clean up ################
---disable_warnings
---disable_query_log
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31;
---enable_query_log
---enable_warnings
#
# Setup differently defined tables on master and slave
@@ -1025,8 +1008,3 @@ SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
connection master;
DROP TABLE t5;
sync_slave_with_master;
---echo
-
-# END of 5.1 tests case
-
-
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
index 3b8e7663ec7..882ef2c4e63 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
@@ -1,19 +1,10 @@
#################################################
-# Author: Jeb
-# Date: 2006-09-07
# Purpose: To test having extra columns on the slave.
##################################################
# Some tests in here requre partitioning
-- source include/have_partition.inc
-########### Clean up ################
---disable_warnings
---disable_query_log
-DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
---enable_query_log
---enable_warnings
-
#################################################
############ Different Table Def Test ###########
#################################################
@@ -448,9 +439,9 @@ if (`SELECT $engine_type != 'NDB'`)
}
#--echo *** Drop t9 ***
-#connection master;
-#DROP TABLE t9;
-#sync_slave_with_master;
+connection master;
+DROP TABLE t9;
+sync_slave_with_master;
############################################
# More columns in slave at middle of table #
@@ -725,6 +716,10 @@ sync_slave_with_master;
--replace_column 5 CURRENT_TIMESTAMP
SELECT * FROM t14a ORDER BY c1;
+--connection master
+DROP TABLE t14a;
+--sync_slave_with_master
+
####################################################
# - Alter Master Dropping columns from the middle. #
# Expect: columns dropped #
@@ -912,17 +907,3 @@ connection slave;
connection master;
DROP TABLE t17;
sync_slave_with_master;
-
-#### Clean Up ####
---disable_warnings
---disable_query_log
-connection master;
-DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
-sync_slave_with_master;
-connection master;
---enable_query_log
---enable_warnings
-
-# END 5.1 Test Case
-
-
diff --git a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
index cd81f2497b8..6817405b2d9 100644
--- a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
+++ b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
@@ -22,4 +22,5 @@ connection master;
select * from t1;
commit;
drop table t1;
--- sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
index 0a1a4503975..5e4fca4a4b8 100644
--- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
+++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
@@ -54,7 +54,6 @@ unlock tables;
connection master;
drop table t3, t4, t5;
-sync_slave_with_master;
-
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
index 8755bf5aa87..19cd1d783e1 100644
--- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test
+++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
@@ -60,6 +60,4 @@ select count(*) from t1 /* must be zero */;
connection master;
drop table t2,t1;
-sync_slave_with_master;
-
-
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
index c7e3d1abc03..01036f72785 100644
--- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
+++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
@@ -40,26 +40,16 @@ if (!$debug_sync_action)
}
# Restart slave
---disable_warnings
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
eval SET @@global.debug= "+d,$dbug_sync_point";
-start slave;
-source include/wait_for_slave_to_start.inc;
+--source include/start_slave.inc
--echo slave is going to hang in get_master_version_and_clock
-connection master;
-# Write file to make mysql-test-run.pl expect the "crash", but don't start
-# it until it's told to
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
-# Send shutdown to the connected server and give
-# it 10 seconds to die before zapping it
-shutdown_server 10;
-
-connection slave;
--echo slave is unblocked
eval SET DEBUG_SYNC=$debug_sync_action;
@@ -74,6 +64,7 @@ connection slave;
# '1040' ER_CON_COUNT_ERROR
# '1053' ER_SERVER_SHUTDOWN
let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
+--let $slave_io_error_is_nonfatal= 1
source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
@@ -82,19 +73,12 @@ source include/wait_for_slave_io_error.inc;
# unset.
eval set @@global.debug = "-d,$dbug_sync_point";
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
-connection master;
-# Turn on reconnect
---enable_reconnect
-
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-
-# Turn off reconnect again
---disable_reconnect
-
-connection slave;
-source include/wait_for_slave_to_start.inc;
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+# We don't source include/wait_for_slave_io_to_start.inc, because the
+# IO thread has an error and wait_for_slave_io_to_start.inc fails if
+# the IO thread has an error.
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Yes
+--source include/wait_for_slave_param.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test
index bd815d9de02..38dfc818041 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test
@@ -1,6 +1,4 @@
###########################################################
-# 2006-02-01: By JBM: Added 1022, ORDER BY
-###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@@ -14,9 +12,6 @@
--echo #
use test;
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
--echo #
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
@@ -42,9 +37,7 @@ eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@@ -63,9 +56,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@@ -83,17 +74,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
--echo #
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
@@ -208,9 +195,7 @@ call foo();
select * from t1;
select * from t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@@ -548,4 +533,5 @@ connection master;
drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
index 844f93d0906..4b883ab90d7 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
@@ -1,6 +1,4 @@
###########################################################
-# 2006-02-08: By JBM:
-###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@@ -20,9 +18,7 @@ create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@@ -41,9 +37,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@@ -59,17 +53,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
@@ -86,3 +76,5 @@ sync_slave_with_master;
connection master;
drop table t1;
# End of 4.1 tests
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index c4fa9f16dc7..4a21123e8a1 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -1,6 +1,3 @@
-# Requires statement logging
--- source include/have_binlog_format_statement.inc
-
# See if replication of a "LOAD DATA in an autoincrement column"
# Honours autoincrement values
# i.e. if the master and slave have the same sequence
@@ -14,13 +11,10 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
+-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
source include/have_innodb.inc;
-connection slave;
-reset master;
-connection master;
-
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
@@ -45,9 +39,7 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fi
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t3;
@@ -59,9 +51,7 @@ drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# See if slave stops when there's a duplicate entry for key error in LOAD DATA
@@ -72,21 +62,16 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
-# The SQL slave thread should be stopped now.
---source include/wait_for_slave_sql_to_stop.inc
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error_and_skip.inc
# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
# takes us directly to the end of the relay log).
-set global sql_slave_skip_counter=1;
-start slave;
sync_with_master;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-echo Last_SQL_Errno=$last_error;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
-echo Last_SQL_Error;
-echo $last_error;
+--source include/check_slave_no_error.inc
# Trigger error again to test CHANGE MASTER
@@ -100,17 +85,15 @@ connection slave;
# The SQL slave thread should be stopped now.
# Exec_Master_Log_Pos should point to the start of Execute event
# for last load data.
---source include/wait_for_slave_sql_to_stop.inc
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
-stop slave;
+--source include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-echo Last_SQL_Errno=$last_error;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
-echo Last_SQL_Error;
-echo $last_error;
+--source include/check_slave_no_error.inc
# Trigger error again to test RESET SLAVE
@@ -125,16 +108,14 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
---source include/wait_for_slave_sql_to_stop.inc
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
reset slave;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-echo Last_SQL_Errno=$last_error;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
-echo Last_SQL_Error;
-echo $last_error;
+--source include/check_slave_no_error.inc
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
@@ -165,6 +146,7 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
drop table t1, t2;
+--source include/stop_slave_io.inc
connection master;
drop table t1, t2;
@@ -178,7 +160,8 @@ DROP TABLE IF EXISTS t1;
# BUG#48297: Schema name is ignored when LOAD DATA is written into binlog,
# replication aborts
--- source include/master-slave-reset.inc
+-- let $rpl_only_running_threads= 1
+-- source include/rpl_reset.inc
-- let $db1= b48297_db1
-- let $db2= b42897_db2
@@ -239,8 +222,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- sync_slave_with_master
-- eval use $db1
-let $diff_table_1=master:$db1.t1;
-let $diff_table_2=slave:$db1.t1;
+let $diff_tables= master:$db1.t1, slave:$db1.t1;
source include/diff_tables.inc;
-- connection master
@@ -251,7 +233,7 @@ source include/diff_tables.inc;
-- sync_slave_with_master
# BUG#49479: LOAD DATA INFILE is binlogged without escaping field names
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
@@ -262,6 +244,6 @@ SELECT * FROM t1;
-- sync_slave_with_master
-- connection master
DROP TABLE t1;
--- sync_slave_with_master
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index e714d84a51b..b812b6ebaee 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -124,7 +124,7 @@ DROP TABLE t3;
# Reset binlog so that show binlog events will not show the tests
# above.
-source include/master-slave-reset.inc;
+source include/rpl_reset.inc;
connection master;
create table t1(a int auto_increment primary key, b int);
diff --git a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
index 8415522ec92..d8cd4f2d284 100644
--- a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
@@ -6,9 +6,6 @@
# Requires statement logging
-- source include/master-slave.inc
-# We have to sync with master, to ensure slave had time to start properly
-# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
-sync_slave_with_master;
connection slave;
stop slave;
connection master;
@@ -117,3 +114,4 @@ set global max_binlog_size= @my_max_binlog_size;
--echo #
--echo # End of 4.1 tests
--echo #
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_query.test b/mysql-test/extra/rpl_tests/rpl_multi_query.test
index 2438556450d..ae2a3aa45d2 100644
--- a/mysql-test/extra/rpl_tests/rpl_multi_query.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_query.test
@@ -7,9 +7,6 @@
# PS doesn't support multi-statements
--disable_ps_protocol
-- source include/master-slave.inc
---disable_warnings
-drop database if exists mysqltest;
---enable_warnings
create database mysqltest;
delimiter /;
@@ -25,4 +22,5 @@ select * from mysqltest.t1;
connection master;
source include/show_binlog_events.inc;
drop database mysqltest;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update.test b/mysql-test/extra/rpl_tests/rpl_multi_update.test
index 121ae18daa8..bf7707f9d6d 100644
--- a/mysql-test/extra/rpl_tests/rpl_multi_update.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update.test
@@ -19,12 +19,11 @@ SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# End of 4.1 tests
connection master;
drop table t1, t2;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
index 3de1d42c34f..6b968fe2e86 100644
--- a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
@@ -226,7 +226,7 @@ connection master;
# Reset both slave and master
# This should reset binlog to #1
---source include/master-slave-reset.inc
+--source include/rpl_reset.inc
--echo
diff --git a/mysql-test/extra/rpl_tests/rpl_not_null.test b/mysql-test/extra/rpl_tests/rpl_not_null.test
index 58dbd9ce29f..86f49d1665c 100644
--- a/mysql-test/extra/rpl_tests/rpl_not_null.test
+++ b/mysql-test/extra/rpl_tests/rpl_not_null.test
@@ -71,12 +71,10 @@ INSERT INTO t4(a) VALUES (5);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
-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;
--echo TABLES t2 and t3 must be different.
@@ -101,8 +99,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
-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;
--echo ************* CLEANING *************
@@ -154,8 +151,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
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;
@@ -273,7 +269,7 @@ sync_slave_with_master;
# SELECT * FROM t3 ORDER BY a;
# connection slave;
# SELECT * FROM t3 ORDER BY a;
-# --source include/reset_master_and_slave.inc
+# --source include/rpl_reset.inc
#
# connection master;
#
diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test
index dc27dcb1f9d..f29e4fb791a 100644
--- a/mysql-test/extra/rpl_tests/rpl_record_compare.test
+++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test
@@ -4,7 +4,7 @@
#
-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval 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=$engine DEFAULT CHARSET=latin1
@@ -16,8 +16,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- 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
@@ -26,7 +25,7 @@ DROP TABLE t1;
-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
-- echo ## (1 column less and no varchar)
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval 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=$engine DEFAULT CHARSET=latin1
@@ -38,8 +37,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- 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
@@ -48,7 +46,7 @@ DROP TABLE t1;
-- echo ## case #2 - X bit is wrongly set.
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
@@ -57,8 +55,7 @@ INSERT INTO t1(c1) VALUES (NULL);
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
diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
index 5c7d33d519e..04ab8751e39 100644
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
@@ -54,9 +54,9 @@ source include/check_slave_no_error.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
-source include/wait_for_slave_io_error.inc;
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
-source include/stop_slave.inc;
change master to master_user='root';
source include/start_slave.inc;
source include/check_slave_no_error.inc;
@@ -69,8 +69,11 @@ source include/stop_slave.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
-source include/wait_for_slave_io_error.inc;
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
-source include/stop_slave.inc;
reset slave;
source include/check_slave_no_error.inc;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_UUID.test b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
index 9f2dbb4ce4b..368596d4fbc 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_UUID.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
@@ -75,5 +75,3 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/r
# this cleanup as no other test will use these files and they'll
# be removed at next testsuite run.
-# End of 5.0 test case
--- source include/master-slave-end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index 84f7b79e733..c8de853a297 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -241,7 +241,7 @@ DELETE FROM t1;
sync_slave_with_master;
# Just to get a clean binary log
-source include/reset_master_and_slave.inc;
+--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@@ -353,8 +353,7 @@ INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 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;
--echo [expecting slave to replicate correctly]
@@ -363,8 +362,7 @@ INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
-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;
--echo [expecting slave to stop]
@@ -374,16 +372,12 @@ INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
---let $slave_sql_errno= 1535
+--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
-connection master;
-RESET MASTER;
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@@ -391,8 +385,7 @@ INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
sync_slave_with_master;
-let $diff_table_1=master:test.t4;
-let $diff_table_2=slave:test.t4;
+let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
--echo [expecting slave to stop]
@@ -402,16 +395,11 @@ INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
---let $slave_sql_errno= 1535
+--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
-connection master;
-RESET MASTER;
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+
+--source include/rpl_reset.inc
--echo [expecting slave to stop]
connection master;
@@ -420,16 +408,11 @@ INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
---let $slave_sql_errno= 1535
+--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
-connection master;
-RESET MASTER;
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+
+--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@@ -437,8 +420,7 @@ INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
sync_slave_with_master;
-let $diff_table_1=master:test.t7;
-let $diff_table_2=slave:test.t7;
+let $diff_tables= master:t7, slave:t7;
source include/diff_tables.inc;
connection master;
@@ -458,8 +440,7 @@ UPDATE t1 SET a = 10;
INSERT INTO t1 VALUES (4);
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;
@@ -537,8 +518,7 @@ UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
--sync_slave_with_master
--echo *** results: t2 must be consistent ****
-let $diff_table_1=master:test.t2;
-let $diff_table_2=master:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--connection master
@@ -576,8 +556,7 @@ UPDATE t1 SET a = 8 WHERE a < 5;
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;
@@ -639,8 +618,7 @@ UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
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;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
index 214027160a9..bad308ff814 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
@@ -14,9 +14,8 @@ flush tables;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
-connection master;
-sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
index 5a2ab1912b8..c52cf344c5f 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp002.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
@@ -1,9 +1,6 @@
#############################################################################
# This test is being created to test out the non deterministic items with #
# row based replication. #
-# Original Author: JBM #
-# Original Date: Aug/09/2005 #
-# Updated: Aug/29/2005 #
#############################################################################
# Test: Contains two stored procedures test one that insert data into tables#
# and use the LAST_INSERTED_ID() on tables with FOREIGN KEY(a) #
@@ -13,9 +10,6 @@
# the table depending on the CASE outcome. The test uses this SP in a#
# transaction first rolling back and then commiting, #
#############################################################################
-# Mod Date: 08/22/2005 #
-# TEST: Added test to include UPDATE CASCADE on table with FK per Trudy #
-#############################################################################
@@ -24,18 +18,6 @@
-- source include/master-slave.inc
-# Begin clean up test section
-connection master;
---disable_warnings
-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;
---enable_warnings
-# End of cleanup
-
# Begin test section 1
eval CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=$engine_type;
@@ -71,9 +53,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p1 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -86,9 +66,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p2 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -136,9 +114,7 @@ SELECT * FROM test.t2;
let $message=< -- test 2 select Slave after p1 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -153,9 +129,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select Slave after p2 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -195,9 +169,7 @@ while ($n)
ROLLBACK;
select * from test.t3;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from test.t3;
connection master;
@@ -216,9 +188,7 @@ while ($n)
COMMIT;
select * from test.t3;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from test.t3;
connection master;
@@ -228,12 +198,12 @@ connection master;
# First lets cleanup
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;
-sync_slave_with_master;
+DROP PROCEDURE test.p3;
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp007.test b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
index 8f2b72e4d32..492cd2d88f1 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp007.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
@@ -1,8 +1,4 @@
#############################################################################
-# Original Author: JBM #
-# Original Date: Aug/15/2005 #
-# Updated: 08/29/2005 Remove sleeps #
-#############################################################################
# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
# rollback to save point and then commits. #
#############################################################################
@@ -10,14 +6,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
-# Begin clean up test section
-connection master;
---disable_warnings
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
---enable_warnings
-# End of cleanup
-
# Begin test section 1
delimiter |;
eval CREATE PROCEDURE test.p1(IN i INT)
@@ -42,9 +30,7 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
let $message=< ---- Master selects-- >;
@@ -55,16 +41,15 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
connection master;
#show binlog events;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_set_null.test b/mysql-test/extra/rpl_tests/rpl_set_null.test
index f2aba089279..3755c8bbfa5 100644
--- a/mysql-test/extra/rpl_tests/rpl_set_null.test
+++ b/mysql-test/extra/rpl_tests/rpl_set_null.test
@@ -29,7 +29,7 @@
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on
# delete cant find record
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine
@@ -37,8 +37,7 @@ INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=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
@@ -46,15 +45,14 @@ UPDATE t1 SET c1=NULL where c2=1;
DELETE FROM t1 WHERE c2=1 LIMIT 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-reset.inc
+-- source include/rpl_reset.inc
-- connection master
@@ -68,8 +66,7 @@ SELECT * FROM t1;
UPDATE t1 SET c1=NULL WHERE c1='w';
-- 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
@@ -77,8 +74,7 @@ UPDATE t1 SET c1=NULL WHERE c1='w';
DELETE FROM t1 LIMIT 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
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
deleted file mode 100644
index 4397e81aadf..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test
+++ /dev/null
@@ -1,131 +0,0 @@
-# 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("Statement may not be safe to log in statement format.");
-
-# 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;
-#hope this is long enough for I/O thread to fetch over 16K relay log data
-sleep 3;
-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).
---source include/wait_for_slave_sql_to_stop.inc
-
-# The following test can't be done because the result of Pos will differ
-# on different computers
-# --replace_result $MASTER_MYPORT MASTER_PORT
-# show slave status;
-
-set global sql_slave_skip_counter=1;
-start slave;
-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
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
index 2c396c9a209..d4140785878 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
@@ -30,6 +30,11 @@ let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Error: "$error" (expected different error codes on master and slave)
--echo Errno: "$errno" (expected 0)
drop table t1;
+--source include/stop_slave.inc
+# Clear error messages.
+RESET SLAVE;
# End of 4.1 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test b/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test
index 65d2483dc4b..cecbd45c02a 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test
@@ -19,10 +19,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1 (c1 INT , c2 INT, c3 char(10), c4
SELECT 'abc' AS c3, 1 AS c4;
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
--echo
@@ -36,10 +39,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
SELECT 'abc', 2;
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
--echo
@@ -57,10 +63,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS test.t1
SELECT 'abc', 20;
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:test.t1,slave:test.t1
+ --source include/diff_tables.inc
}
USE test;
DROP DATABASE db1;
@@ -74,10 +83,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
REPLACE SELECT '123', 2;
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
--echo
@@ -89,10 +101,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
IGNORE SELECT '123', 2;
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
--echo
@@ -103,10 +118,14 @@ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
eval CREATE $_temporary TABLE IF NOT EXISTS t1
SELECT '123', 2;
source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
--echo
@@ -121,10 +140,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
IGNORE (SELECT '123', 3) UNION (SELECT '123', 4);
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
if (!$is_temporary)
@@ -155,10 +177,14 @@ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
call p1(500);
call p1(600);
source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
DROP PROCEDURE p1;
@@ -173,10 +199,14 @@ EXECUTE stm USING @a;
SET @a= 800;
EXECUTE stm USING @a;
source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
--echo
@@ -224,10 +254,13 @@ eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
*/SELECT 'abc', 905;
source include/show_binlog_events.inc;
+--sync_slave_with_master
+--connection master
+
if (!$is_temporary)
{
- let $diff_table= test.t1;
- source include/rpl_diff_tables.inc;
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
}
DROP TABLE t2;
diff --git a/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
index 7c88afe3532..ec6f297caec 100644
--- a/mysql-test/extra/rpl_tests/rpl_stop_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
@@ -52,8 +52,7 @@ source include/wait_for_slave_sql_to_stop.inc;
--echo # Slave should stop after the transaction has committed.
--echo # So t1 on master is same to t1 on 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;
diff --git a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
index 3b6fe7a0ef4..bb740e59b11 100644
--- a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
+++ b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
@@ -1,12 +1,3 @@
-####################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: Added order by in select
-####################
-# Change Date: 2006-02-02
-# Change: renamed to make bettre sense,
-# and wrapped per Engine test
-############################
source include/master-slave.inc;
#
@@ -32,4 +23,4 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_test_framework.inc b/mysql-test/extra/rpl_tests/rpl_test_framework.inc
new file mode 100644
index 00000000000..fb42d2efb9a
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_test_framework.inc
@@ -0,0 +1,86 @@
+# ==== Purpose ====
+#
+# Auxiliary file used by suite/rpl/t/rpl_test_framework.test
+#
+# The purpose is to check that the sync chain generated in
+# rpl_change_topology.inc (invoked from rpl_init.inc) is correct. This
+# is done in two ways:
+# (1) Print the sync chain.
+# (2) Execute a statement and verify that it replicates to all slaves.
+#
+#
+# ==== Implementation ====
+#
+# Does this:
+# (1) Set up a given replication topology (rpl_init.inc)
+# (2) Print $rpl_sync_chain
+# (3) Execute "DELETE FROM t1" and then "INSERT INTO t1" on the master
+# (4) Sync and compare all servers.
+# (5) Clean up the replication topology (rpl_end.inc)
+#
+# (Technical detail: Since DELETE FROM t1 is not executed at the end,
+# some servers may have rows left in t1 from a previous invocation of
+# rpl_test_framework.inc. Therefore, this file will only work in
+# statement mode where "DELETE FROM t1" removes rows that exist on
+# slave but not on master.)
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_server_count= <number>
+# --let $rpl_topology= <topology specification>
+# --let $masters= <list of masters>
+# [--let $rpl_diff_servers= <list of servers>]
+# --source extra/rpl_tests/rpl_test_framework.inc
+#
+# Parameters:
+# $next_number
+# The INSERT statement will insert $next_number into t1, and
+# $next_number will increase by 1.
+#
+# $rpl_server_count, $rpl_topology:
+# See include/rpl_init.inc
+#
+# $masters
+# This should be a list of numbers, each identifying a server.
+# The DELETE and INSERT statements will be executed on all servers
+# in the list.
+#
+# $rpl_diff_servers
+# See include/rpl_diff.inc
+
+--source include/rpl_init.inc
+--source include/rpl_generate_sync_chain.inc
+--echo rpl_sync_chain= '$rpl_sync_chain'
+
+--inc $next_number
+
+# Iterate over masters
+while ($masters)
+{
+ --let $master_i= `SELECT SUBSTRING_INDEX('$masters', ',', 1)`
+ --let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
+
+ # Connect to master and execute statement
+ --let $rpl_connection_name= server_$master_i
+ --source include/rpl_connection.inc
+ DELETE FROM t1;
+ --eval INSERT INTO t1 VALUES ($next_number)
+}
+
+--source include/rpl_sync.inc
+
+# Compare all servers.
+--let $diff_tables= server_$rpl_server_count:t1
+--let $server_i= $rpl_server_count
+--dec $server_i
+while ($server_i)
+{
+ --let $diff_tables= server_$server_i:t1,$diff_tables
+ --dec $server_i
+}
+--source include/diff_tables.inc
+
+--let $diff_servers=
+--let $masters=
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate.test b/mysql-test/extra/rpl_tests/rpl_truncate.test
index 7036ab126e1..c1d70b4dab2 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate.test
@@ -1,11 +1,6 @@
-#
-# Copyright 2006 MySQL. All rights reserved.
-#
# Test to check for the different version of truncating a table.
# The statements are "TRUNCATE tbl" and "DELETE FROM tbl". We check
# the behaviour of each possible value for BINLOG_FORMAT.
-#
-# Author(s): Mats Kindahl
--source include/master-slave.inc
@@ -14,3 +9,5 @@ let $trunc_stmt = TRUNCATE TABLE;
let $trunc_stmt = DELETE FROM;
--source extra/rpl_tests/rpl_truncate_helper.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
index cd1ce93177a..d1d0e06e32f 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
@@ -1,4 +1,4 @@
-source include/reset_master_and_slave.inc;
+--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@@ -10,8 +10,7 @@ connection master;
eval $trunc_stmt t1;
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;
--echo ==== Test using a table with delete triggers ====
@@ -26,8 +25,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
-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;