From 0ea47c97097472be1f3c4a4eae18d522a71a808b Mon Sep 17 00:00:00 2001 From: "John H. Embretsen" Date: Wed, 17 Dec 2008 09:39:01 +0100 Subject: [PATCH 01/11] Fix (preliminary?) for Bug#41502 - MTR v2 should not load plugins during server bootstrap. Adding --loose-skip-falcon option to the mysqld options provided by MTR (v2) during mysqld bootstrap in order to avoid plugin (in this case Falcon) initialization of static variables etc. Options --loose-skip-innodb and --loose-skip-ndbcluster were already included. This will fix Bug#41014 (falcon_bug_39708 fails in pushbuild in 6.0-rpl: "succeeded - should have failed") in the case of MTR v2 (which currently is available in -rpl branches only). MTR v1 (e.g. in main 6.0 branch) does not have this problem. It would be more ideal to remove the --loose-skip-* options and provide a single option disabling all plugin initialization instead, or have bootstrap do this by default. Server modifications are (most likely) needed to be able to do that. mysql-test/mysql-test-run.pl: Reintroduced the --loose-skip-falcon bootstrap option used by the previous version of this test runner. --- mysql-test/mysql-test-run.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 049dbb4aceb..b5325f46943 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2544,6 +2544,7 @@ sub mysql_install_db { mtr_add_arg($args, "--basedir=%s", $install_basedir); mtr_add_arg($args, "--datadir=%s", $install_datadir); mtr_add_arg($args, "--loose-skip-innodb"); + mtr_add_arg($args, "--loose-skip-falcon"); mtr_add_arg($args, "--loose-skip-ndbcluster"); mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); mtr_add_arg($args, "--core-file"); From 29e8163c9f7ddba84d7ba8004b97fb332aeccb95 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Thu, 18 Dec 2008 12:35:48 +0000 Subject: [PATCH 02/11] Enabled test cases that were fixed. --- mysql-test/suite/rpl/t/disabled.def | 3 --- mysql-test/t/disabled.def | 5 ----- 2 files changed, 8 deletions(-) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 7823d8d8c74..5a6487777ed 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -10,7 +10,4 @@ # ############################################################################## -rpl_redirect : Failure is sporadic and and the test is superfluous (mats) -rpl_innodb_bug28430 : Failure on Solaris Bug #36793 -rpl_flushlog_loop : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main rpl_server_id2 : Bug#38540 rpl_server_id2 uses show slave status unnecessarily diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 1f31174c357..71b7def1319 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -9,9 +9,6 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -federated_transactions : Bug#29523 Transactions do not work -log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows -wait_timeout_func : BUG#36873 2008-07-06 sven wait_timeout_func.test fails randomly delayed_insert_limit_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions event_scheduler_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions interactive_timeout_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions @@ -21,8 +18,6 @@ rpl_max_binlog_size_func : BUG#37962 2008-07-08 sven *_func tests c slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions -log_output_func : BUG#37766 2008-07-10 sven main.log_output_func randomly fails in pushbuild slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions log_bin_trust_function_creators_func : Bug#41003 Dec-12-2008 andrei todo:re-enable after merging the bug fixes from the main trees. innodb_max_dirty_pages_pct_func : BUG#41018 BUG#39382 2008-12-02 sven test fails often. some failures fill up the disk, causing subsequent failures in many other tests -wait_timeout_func : Bug #41225 joro wait_timeout_func fails From 949b2f1c0c7aa9862d78cb7eaf296f8fae4464f0 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Thu, 18 Dec 2008 13:58:55 +0100 Subject: [PATCH 03/11] Bug#41480 Tests that do LOAD DATA INFILE fail when run locally mysql-test/lib/My/File/Path.pm: Extend 'copytree' to take an optional "umask" parameter that will be used while copying the files mysql-test/mysql-test-run.pl: Pass umask 0022 to copytree so that the copied files will be created world readable and the mysqld can LOAD DATA INFILE them --- mysql-test/lib/My/File/Path.pm | 16 ++++++++++++++-- mysql-test/mysql-test-run.pl | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mysql-test/lib/My/File/Path.pm b/mysql-test/lib/My/File/Path.pm index eeb7546b0b8..7ef1211ff52 100644 --- a/mysql-test/lib/My/File/Path.pm +++ b/mysql-test/lib/My/File/Path.pm @@ -92,9 +92,16 @@ sub mkpath { sub copytree { - my ($from_dir, $to_dir) = @_; + my ($from_dir, $to_dir, $use_umask) = @_; - die "Usage: copytree(, " unless @_ == 2; + die "Usage: copytree(, , [])" + unless @_ == 2 or @_ == 3; + + my $orig_umask; + if ($use_umask){ + # Set new umask and remember the original + $orig_umask= umask(oct($use_umask)); + } mkpath("$to_dir"); opendir(DIR, "$from_dir") @@ -114,6 +121,11 @@ sub copytree { copy("$from_dir/$_", "$to_dir/$_"); } closedir(DIR); + + if ($orig_umask){ + # Set the original umask + umask($orig_umask); + } } 1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 049dbb4aceb..87aa2f48daf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1981,8 +1981,8 @@ sub setup_vardir() { } # copy all files from std_data into var/std_data - # and make them writable - copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data"); + # and make them world readable + copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022"); # Remove old log files foreach my $name (glob("r/*.progress r/*.log r/*.warnings")) From 970be2ba705206afce0e2c4bc89d56371cb710af Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Thu, 18 Dec 2008 19:36:01 +0100 Subject: [PATCH 04/11] Fix merge error, mysqltest.cc should be mysqltest.c --- libmysqld/examples/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index 346278425a7..fa9711b54da 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -32,7 +32,7 @@ ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32) ADD_DEPENDENCIES(mysql_embedded libmysqld) -ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c) +ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc) TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32) ADD_DEPENDENCIES(mysqltest_embedded libmysqld) From 606603db95d6b83783e52c10a85a1c2b95a17150 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Thu, 18 Dec 2008 19:37:18 +0000 Subject: [PATCH 05/11] Post-fix merge 5-1 --> 5.1-rpl. Fixed mysqlcheck.test var directories. --- mysql-test/t/mysqlcheck.test | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index da00ea0c2bf..4d196cb86ad 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -82,7 +82,6 @@ create view v1 as select * from information_schema.routines; check table v1, information_schema.routines; drop view v1; - # # Bug#37527: mysqlcheck fails to report entire database # when frm file corruption @@ -90,20 +89,21 @@ drop view v1; CREATE TABLE t1(a INT); CREATE TABLE t2(a INT); # backup then null t1.frm ---copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ---write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm +--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak +--remove_file $MYSQLD_DATADIR/test/t1.frm +--write_file $MYSQLD_DATADIR/test/t1.frm EOF --exec $MYSQL_CHECK test # restore t1.frm ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ---copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak $MYSQLTEST_VARDIR/master-data/test/t1.frm ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak +--remove_file $MYSQLD_DATADIR/test/t1.frm +--copy_file $MYSQLD_DATADIR/test/t1.frm.bak $MYSQLD_DATADIR/test/t1.frm +--remove_file $MYSQLD_DATADIR/test/t1.frm.bak DROP TABLE t1, t2; --echo End of 5.0 tests + # # Bug #30679: 5.1 name encoding not performed for views during upgrade # @@ -117,3 +117,6 @@ show tables; show tables; drop view v1, `v-1`; drop table t1; + + +--echo End of 5.1 tests From 87ebdef9eae4afcef7b3bdd1196fa0134c076f90 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Fri, 19 Dec 2008 03:02:20 +0000 Subject: [PATCH 06/11] Post-fix merge 5-1 --> 5.1-rpl. Changed mysqlcheck.result. --- mysql-test/r/mysqlcheck.result | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 0b0ce3c2ba4..e35e0870264 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -4,6 +4,10 @@ drop database if exists client_test_db; mtr.global_suppressions OK mtr.suspicious_patterns OK mtr.test_suppressions OK +mysql.backup_history +note : The storage engine for the table doesn't support optimize +mysql.backup_progress +note : The storage engine for the table doesn't support optimize mysql.columns_priv OK mysql.db OK mysql.event OK @@ -29,6 +33,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK +mysql.backup_history +note : The storage engine for the table doesn't support optimize +mysql.backup_progress +note : The storage engine for the table doesn't support optimize mysql.columns_priv OK mysql.db OK mysql.event OK @@ -133,3 +141,4 @@ v1 v-1 drop view v1, `v-1`; drop table t1; +End of 5.1 tests From e8d5395c42180404c478b4fc8da46c1c3124cca8 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Fri, 19 Dec 2008 10:11:48 +0000 Subject: [PATCH 07/11] Post-fix merge 5-1 --> 5.1-rpl. Changed mysqlcheck.result. Note that this result set is different from that in 6.0/6.0-rpl. --- mysql-test/r/mysqlcheck.result | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index e35e0870264..b98a800fb36 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -4,10 +4,6 @@ drop database if exists client_test_db; mtr.global_suppressions OK mtr.suspicious_patterns OK mtr.test_suppressions OK -mysql.backup_history -note : The storage engine for the table doesn't support optimize -mysql.backup_progress -note : The storage engine for the table doesn't support optimize mysql.columns_priv OK mysql.db OK mysql.event OK @@ -33,10 +29,6 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -mysql.backup_history -note : The storage engine for the table doesn't support optimize -mysql.backup_progress -note : The storage engine for the table doesn't support optimize mysql.columns_priv OK mysql.db OK mysql.event OK From 2d06a00ddadccaa87fdb37d11e9ed11ec278f79d Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Fri, 19 Dec 2008 16:48:31 +0100 Subject: [PATCH 08/11] Bug #40704 main.events_restart fails sporadically in pushbuild: "server has gone away" mysql-test/include/wait_until_disconnected.inc: Allow 2013 as an expected error code --- mysql-test/include/wait_until_disconnected.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc index 956ab3c1845..a4362e52d01 100644 --- a/mysql-test/include/wait_until_disconnected.inc +++ b/mysql-test/include/wait_until_disconnected.inc @@ -7,7 +7,7 @@ let $counter= 500; let $mysql_errno= 0; while (!$mysql_errno) { - --error 0,1053,2002,2006 + --error 0,1053,2002,2006,2013 show status; dec $counter; From 126c0b4433e94aab3cb728cb4e7bb93e3e4ccabe Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 19 Dec 2008 20:59:22 +0200 Subject: [PATCH 09/11] Bug#38934 slave slave until does not work with --replicate-same-server-id Bug#38540 rpl_server_id2 uses show slave status unnecessarily Slave did not perform any event recorded into the relay log from some different master when it was started with --replicate-same-server-id. The reason appeared to be a consequence of BUG#38734 which stopped the sql thread at its startup time. The real fixes for the current bug are in the patch for BUG#38734. This changeset carries only a regression test for the bugs. Bug#38540 gets fixed too by means of eliminating an extra show slave status. mysql-test/suite/rpl/r/rpl_server_id2.result: Bug#38934 Bug#38540 changed results. mysql-test/suite/rpl/t/disabled.def: rpl_server_id2 is re-enabled. mysql-test/suite/rpl/t/rpl_server_id2.test: regression test for BUG#38734 is added. Bug#38540 requirement to get rid of show slave status is implemented. --- mysql-test/suite/rpl/r/rpl_server_id2.result | 51 +++++--------------- mysql-test/suite/rpl/t/disabled.def | 1 - mysql-test/suite/rpl/t/rpl_server_id2.test | 44 +++++++++++++++-- 3 files changed, 52 insertions(+), 44 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result index f68f9ff829d..25ed49d8c3b 100644 --- a/mysql-test/suite/rpl/r/rpl_server_id2.result +++ b/mysql-test/suite/rpl/r/rpl_server_id2.result @@ -8,45 +8,6 @@ create table t1 (n int); reset master; stop slave; change master to master_port=SLAVE_PORT; -show slave status; -Slave_IO_State -Master_Host 127.0.0.1 -Master_User root -Master_Port SLAVE_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos 4 -Relay_Log_File slave-relay-bin.000001 -Relay_Log_Pos 4 -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table # -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 0 -Relay_Log_Space 106 -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master NULL -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error start slave; insert into t1 values (1); select * from t1; @@ -55,3 +16,15 @@ n 1 stop slave; drop table t1; +reset master; +create table t1(n int); +create table t2(n int); +change master to master_port=MASTER_PORT; +start slave until master_log_file='master-bin.000001', master_log_pos=107; +*** checking until postion execution: must be only t1 in the list *** +show tables; +Tables_in_test +t1 +start slave sql_thread; +drop table t1; +drop table t2; diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 7823d8d8c74..ebdb8014f88 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -13,4 +13,3 @@ rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_innodb_bug28430 : Failure on Solaris Bug #36793 rpl_flushlog_loop : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main -rpl_server_id2 : Bug#38540 rpl_server_id2 uses show slave status unnecessarily diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test index 7e67fb42b4f..a9c789e97bf 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id2.test +++ b/mysql-test/suite/rpl/t/rpl_server_id2.test @@ -9,9 +9,6 @@ reset master; stop slave; --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_port=$SLAVE_MYPORT; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 18 # 35 # 36 # -query_vertical show slave status; start slave; insert into t1 values (1); save_master_pos; @@ -23,4 +20,43 @@ select * from t1; # check that indeed 2 were inserted stop slave; drop table t1; -# End of 4.1 tests + +# +# Bug#38934 slave slave until does not work with --replicate-same-server-id +# +# Verifying that slave performs all events until the master_log_pos +# in presense of --replicate-same-server-id the slave is started with. + +connection master; +reset master; + +# setting the until position to correspond to the first following create table +# which will make the event executed and the slave sql thread stopped +# right after that. +let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1); +inc $until_pos; + +create table t1(n int); +create table t2(n int); + +connection slave; +--replace_result $MASTER_MYPORT MASTER_PORT +eval change master to master_port=$MASTER_MYPORT; +eval start slave until master_log_file='master-bin.000001', master_log_pos=$until_pos; +--source include/wait_for_slave_io_to_start.inc +--source include/wait_for_slave_sql_to_stop.inc + +--echo *** checking until postion execution: must be only t1 in the list *** +show tables; + +# cleanup + +connection slave; +start slave sql_thread; + +connection master; +drop table t1; +drop table t2; +sync_slave_with_master; + +# End of tests From f8fe9e0953f62534b0e2ff9c2b8b43870a66ceca Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 19 Dec 2008 22:13:12 +0200 Subject: [PATCH 10/11] Bug#38540 rpl_server_id2 uses show slave status unnecessarily a minor improvement to the test to ease merging. mysql-test/suite/rpl/r/rpl_server_id2.result: results changed. mysql-test/suite/rpl/t/rpl_server_id2.test: masking out the until_pos which value is out of interest but it presence hurts merging between trees. --- mysql-test/suite/rpl/r/rpl_server_id2.result | 2 +- mysql-test/suite/rpl/t/rpl_server_id2.test | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result index 25ed49d8c3b..bb5a175fbfe 100644 --- a/mysql-test/suite/rpl/r/rpl_server_id2.result +++ b/mysql-test/suite/rpl/r/rpl_server_id2.result @@ -20,7 +20,7 @@ reset master; create table t1(n int); create table t2(n int); change master to master_port=MASTER_PORT; -start slave until master_log_file='master-bin.000001', master_log_pos=107; +start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS; *** checking until postion execution: must be only t1 in the list *** show tables; Tables_in_test diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test index a9c789e97bf..488a3aa6ab6 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id2.test +++ b/mysql-test/suite/rpl/t/rpl_server_id2.test @@ -42,6 +42,7 @@ create table t2(n int); connection slave; --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_port=$MASTER_MYPORT; +--replace_result $until_pos UNTIL_POS eval start slave until master_log_file='master-bin.000001', master_log_pos=$until_pos; --source include/wait_for_slave_io_to_start.inc --source include/wait_for_slave_sql_to_stop.inc From dbb7b40cda3963d64c6507e7a8eabb90667e357b Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Fri, 26 Dec 2008 16:20:29 +0800 Subject: [PATCH 11/11] BUG#41708 rpl.rpl_flushlog_loop fails in pushbuild producing non-deterministic result file If server has not been initialized as a slave (by CHANGE MASTER), then SHOW SLAVE STATUS will return an empty set, and caused the waiting for Slave_IO_running or Slave_SQL_running to 'No' fail. This patch fixed the problem by return immediately if slave is not initialized in include/wait_for_slave_*_to_stop.inc. mysql-test/include/wait_for_slave_io_to_stop.inc: Return immediately if slave is not initialized mysql-test/include/wait_for_slave_sql_to_stop.inc: Return immediately if slave is not initialized mysql-test/include/wait_for_slave_to_stop.inc: Return immediately if slave is not initialized --- .../include/wait_for_slave_io_to_stop.inc | 16 +++++++++----- .../include/wait_for_slave_sql_to_stop.inc | 16 +++++++++----- mysql-test/include/wait_for_slave_to_stop.inc | 22 ++++++++++++------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc index 0111edaff58..16a03d94511 100644 --- a/mysql-test/include/wait_for_slave_io_to_stop.inc +++ b/mysql-test/include/wait_for_slave_io_to_stop.inc @@ -11,8 +11,14 @@ # $slave_keep_connection. See wait_for_slave_param.inc for # descriptions. -let $slave_param= Slave_IO_Running; -let $slave_param_value= No; -let $slave_error_message= Failed while waiting for slave IO thread to stop; -source include/wait_for_slave_param.inc; -let $slave_error_message= ; +# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE +# STATUS will return an empty set. +let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); +if (`SELECT '$_slave_io_running' != 'No such row'`) +{ + let $slave_param= Slave_IO_Running; + let $slave_param_value= No; + let $slave_error_message= Failed while waiting for slave IO thread to stop; + source include/wait_for_slave_param.inc; + let $slave_error_message= ; +} diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc index 477dfecbb30..565203a9f59 100644 --- a/mysql-test/include/wait_for_slave_sql_to_stop.inc +++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -11,8 +11,14 @@ # $slave_keep_connection. See wait_for_slave_param.inc for # descriptions. -let $slave_param= Slave_SQL_Running; -let $slave_param_value= No; -let $slave_error_message= Failed while waiting for slave SQL thread to stop; -source include/wait_for_slave_param.inc; -let $slave_error_message= ; +# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE +# STATUS will return an empty set. +let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); +if (`SELECT '$_slave_io_running' != 'No such row'`) +{ + let $slave_param= Slave_SQL_Running; + let $slave_param_value= No; + let $slave_error_message= Failed while waiting for slave SQL thread to stop; + source include/wait_for_slave_param.inc; + let $slave_error_message= ; +} diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc index 4973a27dc53..86604a15b95 100644 --- a/mysql-test/include/wait_for_slave_to_stop.inc +++ b/mysql-test/include/wait_for_slave_to_stop.inc @@ -11,14 +11,20 @@ # $slave_keep_connection. See wait_for_slave_param.inc for # descriptions. -let $slave_error_message= Failed while waiting for slave to stop; +# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE +# STATUS will return an empty set. +let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); +if (`SELECT '$_slave_io_running' != 'No such row'`) +{ + let $slave_error_message= Failed while waiting for slave to stop; -let $slave_param= Slave_IO_Running; -let $slave_param_value= No; -source include/wait_for_slave_param.inc; + let $slave_param= Slave_IO_Running; + let $slave_param_value= No; + source include/wait_for_slave_param.inc; -let $slave_param= Slave_SQL_Running; -let $slave_param_value= No; -source include/wait_for_slave_param.inc; + let $slave_param= Slave_SQL_Running; + let $slave_param_value= No; + source include/wait_for_slave_param.inc; -let $slave_error_message= ; + let $slave_error_message= ; +}