summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl
diff options
context:
space:
mode:
authorSven Sandberg <sven@mysql.com>2008-07-10 18:09:39 +0200
committerSven Sandberg <sven@mysql.com>2008-07-10 18:09:39 +0200
commit78c8bfdddf7d3b42c14bd2a8ac312610dd015b9b (patch)
tree7e30a569062abb6dd5dbca89c6ce5c34ab523780 /mysql-test/suite/rpl
parent87d16037002693337ae0167ef388e3def5eed5a8 (diff)
downloadmariadb-git-78c8bfdddf7d3b42c14bd2a8ac312610dd015b9b.tar.gz
BUG#37975: wait_for_slave_* should increase the timeout
Problem 1: tests often fail in pushbuild with a timeout when waiting for the slave to start/stop/receive error. Fix 1: Updated the wait_for_slave_* macros in the following way: - The timeout is increased by a factor ten - Refactored the macros so that wait_for_slave_param does the work for the other macros. Problem 2: Tests are often incorrectly written, lacking a source include/wait_for_slave_to_[start|stop].inc. Fix 2: Improved the chance to get it right by adding include/start_slave.inc and include/stop_slave.inc, and updated tests to use these. Problem 3: The the built-in test language command wait_for_slave_to_stop is a misnomer (does not wait for the slave io thread) and does not give as much debug info in case of failure as the otherwise equivalent macro source include/wait_for_slave_sql_to_stop.inc Fix 3: Replaced all calls to the built-in command by a call to the macro. Problem 4: Some, but not all, of the wait_for_slave_* macros had an implicit connection slave. This made some tests confusing to read, and made it more difficult to use the macro in circular replication scenarios, where the connection named master needs to wait. Fix 4: Removed the implicit connection slave from all wait_for_slave_* macros, and updated tests to use an explicit connection slave where necessary. Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc were unused. Moreover, using them is difficult and error-prone. Fix 5: remove these macros. Problem 6: log_bin_trust_function_creators_basic failed when running tests because it assumed @@global.log_bin_trust_function_creators=1, and some tests modified this variable without resetting it to its original value. Fix 6: All tests that use this variable have been updated so that they reset the value at end of test.
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_found_rows.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result4
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency.test23
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test16
41 files changed, 149 insertions, 213 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
index 1f986c40934..c6dd2d01ed3 100644
--- a/mysql-test/suite/rpl/r/rpl_bug26395.result
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -21,7 +21,7 @@ a
1
[on slave]
==== Verify results on slave ====
-STOP SLAVE;
+include/stop_slave.inc
SELECT "" AS Slave_IO_State;
Slave_IO_State
diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
index 4f0f20d88d9..ba4e22232a0 100644
--- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -92,7 +92,7 @@ Master D 4 D
* Do failure for C and then make new connection B->D *
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE;
+include/start_slave.inc
INSERT INTO t1 VALUES(6,'C',2);
INSERT INTO t1(b,c) VALUES('B',2);
INSERT INTO t1(b,c) VALUES('A',2);
@@ -119,7 +119,7 @@ Master D 8 D
STOP SLAVE;
STOP SLAVE;
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
-START SLAVE;
+include/start_slave.inc
* Check data inserted before failure *
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
@@ -166,7 +166,7 @@ Master D 12 D
*** Testing restoring scheme A->B->C->D->A after failure ***
* Remove wrong event from C and restore B->C->D *
-STOP SLAVE;
+include/stop_slave.inc
DELETE FROM t1 WHERE a = 6;
START SLAVE;
RESET MASTER;
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index 23f2b845ca6..600ac44fc86 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -18,11 +18,7 @@ start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
+include/start_slave.inc
FLUSH LOGS;
SHOW SLAVE STATUS;
Slave_IO_State #
diff --git a/mysql-test/suite/rpl/r/rpl_found_rows.result b/mysql-test/suite/rpl/r/rpl_found_rows.result
index 25be9eb63b3..45a931872cf 100644
--- a/mysql-test/suite/rpl/r/rpl_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_found_rows.result
@@ -103,10 +103,10 @@ DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
#### 2. Using mixed mode ####
==== 2.1. Checking a procedure ====
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 5ff72e57f0e..908abf56c1f 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set global max_connections=151;
-stop slave;
-start slave;
+include/stop_slave.inc
+include/start_slave.inc
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
@@ -25,6 +25,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
-stop slave;
+include/stop_slave.inc
set global init_connect= @my_global_init_connect;
set global max_connections= default;
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index e0c4dedde10..7b3ebf62959 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -7,7 +7,7 @@ start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
-stop slave;
+include/stop_slave.inc
change master to master_log_pos=75;
SHOW SLAVE STATUS;
Slave_IO_State #
@@ -49,7 +49,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+include/stop_slave.inc
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index f89d6b3459a..68173b0730c 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -8,8 +8,8 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
-STOP SLAVE;
-START SLAVE;
+include/stop_slave.inc
+include/start_slave.inc
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
@@ -27,8 +27,8 @@ SLAVE_RUNNING ON
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
-STOP SLAVE;
-START SLAVE;
+include/stop_slave.inc
+include/start_slave.inc
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
show slave status;
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index ecd59005b59..05af65306c1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 4fc2bc6d714..db7105e5c09 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -423,10 +423,10 @@ a b c
**** On Master ****
DELETE FROM t1;
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
index b32da2715e3..562e3dc2862 100644
--- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -16,6 +16,6 @@ INSERT INTO t1 VALUES (1);
[on slave]
Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
==== Clean up ====
-STOP SLAVE;
+include/stop_slave.inc
[on master]
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index 67dab254ccc..1b6fce5e206 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
reset master;
@@ -113,11 +113,7 @@ Aberdeen
Abernathy
aberrant
aberration
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
+include/start_slave.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -190,7 +186,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -220,7 +217,6 @@ show binary logs;
Log_name File_size
master-bin.000001 1540
master-bin.000002 516
-start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1638
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index f526418a01a..14d4412f6de 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
reset master;
@@ -113,11 +113,7 @@ Aberdeen
Abernathy
aberrant
aberration
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
+include/start_slave.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -190,7 +186,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=InnoDB;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -220,7 +217,6 @@ show binary logs;
Log_name File_size
master-bin.000001 1456
master-bin.000002 474
-start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1536
diff --git a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
index 584a3af4543..1934b01505c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
@@ -13,4 +13,5 @@ select count(*) from t1;
count(*)
70
drop table t1;
+include/stop_slave.inc
drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index a6d1b085b34..be1ec51f74a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -149,7 +149,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+include/stop_slave.inc
start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
SHOW SLAVE STATUS;
Slave_IO_State #
diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
index cfd309e6251..eb3c4ef5978 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -44,9 +44,9 @@ a b
SELECT * FROM t2 ORDER BY a;
a b
1 AA_for_row_or_YY_for_stmt_mixed
-STOP SLAVE;
+include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
-START SLAVE;
+include/start_slave.inc
TRUNCATE t1;
TRUNCATE t2;
TRUNCATE t3;
@@ -78,9 +78,9 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
-STOP SLAVE;
+include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
-START SLAVE;
+include/start_slave.inc
TRUNCATE t1;
TRUNCATE t2;
TRUNCATE t3;
@@ -116,8 +116,8 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
-STOP SLAVE;
+include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
-START SLAVE;
+include/start_slave.inc
*** Clean up ***
DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index 1f975b7dbcd..75d1c019098 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -166,7 +166,7 @@ BEGIN
UPDATE t3 SET a =2, b = 'master only';
END|
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
**** On Master ****
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1;
@@ -188,7 +188,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a b
1 master/slave
@@ -208,7 +208,7 @@ CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (2, 'master only');
@@ -234,7 +234,7 @@ a b
3 master/slave
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -245,7 +245,7 @@ SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
**** On Slave ****
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
BEGIN;
INSERT INTO t4 VALUES (6, 'master only');
@@ -277,7 +277,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -287,7 +287,7 @@ a b
SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
-STOP SLAVE;
+include/stop_slave.inc
SET AUTOCOMMIT=0;
INSERT INTO t4 VALUES (4, 'master only');
INSERT INTO t5 VALUES (4, 'master only');
@@ -323,7 +323,7 @@ a b
7 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
a b
3 master/slave
@@ -341,7 +341,7 @@ DROP TABLE t4, t5, t6;
*** On Master ***
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
*** On Slave ***
-STOP SLAVE;
+include/stop_slave.inc
*** On Master ***
SET SESSION BINLOG_FORMAT=STATEMENT;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
@@ -352,7 +352,7 @@ a b
3 master only
*** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
DROP TABLE t10;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index dc27c513149..a98a81dc74f 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -8,9 +8,9 @@ start slave;
[on master]
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
[on slave]
-STOP SLAVE;
+include/stop_slave.inc
CHANGE MASTER TO master_user='rpl', master_password='rpl';
-START SLAVE;
+include/start_slave.inc
==== Do replication as new user ====
[on master]
CREATE TABLE t1 (n INT);
@@ -25,7 +25,7 @@ DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES;
[on slave]
==== Restart slave without privileges =====
-STOP SLAVE;
+include/stop_slave.inc
START SLAVE;
==== Verify that Slave_IO_Running = No ====
Slave_IO_Running = No (should be No)
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 3822da77b75..27a956eb526 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -191,11 +191,15 @@ begin
return unix_timestamp();
end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_routine_creators=1;
Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
create function fn2()
returns int
@@ -549,8 +553,14 @@ insert into t values (1);
return 0;
end
master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
-set global log_bin_trust_function_creators=0;
-set global log_bin_trust_function_creators=0;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+Warnings:
+Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+Warnings:
+Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database mysqltest;
drop database mysqltest2;
use test;
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index a39d189aa3a..d9cdfd81167 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
drop function if exists f1;
@@ -275,5 +276,5 @@ E
drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 77d3c92ab30..eefac3ca13d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
reset master;
reset slave;
reset master;
@@ -109,11 +109,7 @@ Aberdeen
Abernathy
aberrant
aberration
-start slave;
-
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
-
---source include/wait_slave_status.inc
+include/start_slave.inc
select * from t1 order by 1 asc;
word
Aarhus
@@ -186,7 +182,8 @@ Abernathy
aberrant
aberration
flush logs;
-stop slave;
+include/stop_slave.inc
+include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
show binlog events from <binlog_start>;
@@ -209,7 +206,6 @@ show binary logs;
Log_name File_size
master-bin.000001 1347
master-bin.000002 392
-start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1450
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 619115aa534..c488b4d7b13 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-stop slave;
+include/stop_slave.inc
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -149,7 +149,7 @@ Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
start slave;
-stop slave;
+include/stop_slave.inc
start slave until master_log_file='master-bin.000001', master_log_pos=776;
SHOW SLAVE STATUS;
Slave_IO_State #
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 73354666b7a..bf6792f9f96 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -40,10 +40,10 @@ SET @user_num = 10;
SET @user_text = 'Alunda';
[on master]
**** Resetting master and slave ****
-STOP SLAVE;
+include/stop_slave.inc
RESET SLAVE;
RESET MASTER;
-START SLAVE;
+include/start_slave.inc
[on slave]
SET @@global.init_slave = 'ant';
[on master]
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
index 5d5f8f7fa5e..97c152d52e9 100644
--- a/mysql-test/suite/rpl/t/rpl_bug26395.test
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -23,7 +23,7 @@
#
# To simulate the slave correctly, we wait until everything up to but
# not including the XID is replicated. This has to be done with
-# include/wait_for_slave_io_to_sync.inc, not sync_slave_with_master,
+# include/sync_slave_io_with_master.inc, not sync_slave_with_master,
# since the latter waits until the slave *SQL* thread has caught up
# with the master's position, which it will never do.
#
@@ -70,8 +70,7 @@ sync_with_master 0;
--echo ==== Verify results on slave ====
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
eval SELECT "$tmp" AS Slave_IO_State;
let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
index bca20ef79c4..4628c0e97f7 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -57,8 +57,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+source include/start_slave.inc;
disconnect slave;
--connection master_c
INSERT INTO t1 VALUES(6,'C',2);
@@ -67,9 +66,7 @@ INSERT INTO t1 VALUES(6,'C',2);
INSERT INTO t1(b,c) VALUES('B',2);
# Wait while C will stop.
--connection master_c
---let $slave_param= Slave_SQL_Running
---let $slave_param_value= No
---source include/wait_for_slave_param.inc
+source include/wait_for_slave_sql_to_stop.inc;
--connection master_a
INSERT INTO t1(b,c) VALUES('A',2);
--connection master_d
@@ -105,8 +102,7 @@ STOP SLAVE;
--replace_result $SLAVE_MYPORT MASTER_B_PORT $file_c LOG_FILE $pos_c LOG_POS
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+source include/start_slave.inc;
disconnect slave;
--connection master_b
--sync_slave_with_master master_d
@@ -154,8 +150,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
# distributed to other servers
--echo * Remove wrong event from C and restore B->C->D *
--connection master_d
-STOP SLAVE;
---wait_for_slave_to_stop
+source include/stop_slave.inc;
--connection master_c
DELETE FROM t1 WHERE a = 6;
START SLAVE;
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
index 7ab9064b7f6..11dd46727dc 100644
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
@@ -12,7 +12,7 @@ source include/have_innodb.inc;
# set up "dual head"
-let $keep_connection= 1;
+let $slave_keep_connection= 1;
connection slave;
reset master;
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index f37df68ac3b..a8befe612c2 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -25,13 +25,8 @@ stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
-start slave;
-#
-# Wait for start of slave IO and SQL threads
-#
-let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
+source include/start_slave.inc;
#
# Flush logs of slave
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test
index 0dc687a8656..989066dad2e 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test
@@ -207,9 +207,8 @@ select * from ti1 order by b /* must be (2),(3) */;
# foreign key: row is referenced
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -240,11 +239,10 @@ delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
---echo *** slave must stop
-
-source include/wait_for_slave_sql_to_stop.inc;
+--echo *** slave must stop
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -282,9 +280,8 @@ connection master;
insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -318,9 +315,8 @@ connection master;
DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -337,9 +333,8 @@ set global slave_exec_mode='STRICT';
connection master;
DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -360,9 +355,8 @@ connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -381,9 +375,8 @@ connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop
-source include/wait_for_slave_sql_to_stop.inc;
-
connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 507cd0e0798..3e2eb32a4ff 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -14,7 +14,7 @@ REPLACE INTO t1 VALUES (4);
SELECT * FROM t1;
connection slave;
---wait_for_slave_to_stop
+source include/wait_for_slave_sql_to_stop.inc;
# The 4 should not be inserted into the table, since the incident log
# event should have stop the slave.
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 1511bd541ed..58d1f6bdc01 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
@@ -7,33 +7,25 @@ source include/master-slave.inc;
set global max_connections=151;
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
-start slave;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
connection master;
-save_master_pos;
-connection slave;
+sync_slave_with_master;
show variables like 'init_slave';
show variables like 'max_connections';
-sync_with_master;
reset master;
connection master;
show variables like 'init_slave';
show variables like 'max_connections';
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# Save variable value
set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1";
show variables like 'init_connect';
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
# Restore changed global variable
set global init_connect= @my_global_init_connect;
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index 45a097b6f14..5e8390f97ed 100644
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -13,20 +13,14 @@
source include/master-slave.inc;
source include/show_master_status.inc;
sync_slave_with_master;
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/stop_slave.inc;
change master to master_log_pos=75;
source include/show_slave_status2.inc;
start slave;
-let $slave_param= Slave_SQL_Running;
-let $slave_param_value= Yes;
---source include/wait_for_slave_param.inc
-let $slave_param= Slave_IO_Running;
-let $slave_param_value= No;
---source include/wait_for_slave_param.inc
-stop slave;
---source include/wait_for_slave_to_stop.inc
+source include/wait_for_slave_sql_to_start.inc;
+source include/wait_for_slave_io_to_stop.inc;
+source include/stop_slave.inc;
source include/show_slave_status.inc;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 1bde61aef78..95293b1e7ac 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -18,10 +18,8 @@ SET @@global.net_buffer_length=1024;
# Restart slave for setting to take effect
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
@@ -65,10 +63,8 @@ SET @@global.net_buffer_length=4096;
# Restart slave for new setting to take effect
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/stop_slave.inc;
+source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
index 6add7302f55..0c038c41ebf 100644
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -35,8 +35,7 @@ let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $err
--echo ==== Clean up ====
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo [on master]
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
index 82c4b1a9936..9b24c78e62d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
@@ -15,12 +15,12 @@ save_master_pos;
connection slave;
-# slave will automatically tell itself to stop thanks to the .opt
+# slave will automatically stop the sql thread thanks to the .opt
# file; it will initiate the stop request after the first
# Rows_log_event (out of 3) but should wait until the last one is
# executed before stopping.
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
# check that we inserted all rows (waited until the last Rows event)
select count(*) from t1;
@@ -28,4 +28,5 @@ select count(*) from t1;
connection master;
drop table t1;
connection slave; # slave SQL thread is stopped
+source include/stop_slave.inc;
drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index 4b05e86403d..d89de7d9ebd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -9,12 +9,8 @@ let $VERSION=`select version()`;
# stop slave before he will start replication also sync with master
# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+sync_slave_with_master;
+--source include/stop_slave.inc
connection master;
# create some events on master
@@ -53,9 +49,7 @@ connection master;
save_master_pos;
connection slave;
sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+--source include/stop_slave.inc
# this should stop immediately as we are already there
start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
index 5838fe98de4..879c9b6c585 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id1.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
@@ -9,8 +9,7 @@ connection slave;
reset master;
# replicate ourselves
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
start slave;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
index 94d8ffb4edc..1a0ff8d52f0 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -77,11 +77,9 @@ if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
SELECT * FROM t2 ORDER BY a;
}
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
+--source include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+--source include/start_slave.inc
--connection master
TRUNCATE t1;
@@ -121,11 +119,9 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
+--source include/stop_slave.inc
RENAME TABLE t3_bak TO t3;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+--source include/start_slave.inc
--connection master
TRUNCATE t1;
@@ -167,11 +163,9 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
+source include/stop_slave.inc;
RENAME TABLE t3_bak TO t3;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+source include/start_slave.inc;
# Clean up
--echo *** Clean up ***
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index ce308f975aa..e87fa251c80 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -110,8 +110,7 @@ DELIMITER ;|
--echo **** On Slave ****
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo **** On Master ****
connection master;
@@ -131,8 +130,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t1 ORDER BY a;
@@ -156,8 +154,7 @@ CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
--echo **** On Slave ****
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -182,8 +179,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -194,8 +190,7 @@ SELECT * FROM t6 ORDER BY a;
--echo **** On Slave ****
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -220,8 +215,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -232,8 +226,7 @@ SELECT * FROM t6 ORDER BY a;
# And the same, but with autocommit = 0
#
connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
connection master;
SET AUTOCOMMIT=0;
@@ -257,8 +250,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t4 ORDER BY a;
@@ -280,8 +272,7 @@ CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
--echo *** On Slave ***
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
--echo *** On Master ***
connection master;
@@ -297,8 +288,7 @@ save_master_pos;
--echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
sync_with_master;
SELECT * FROM t10 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index c34af353089..4edf1802a5d 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -27,11 +27,9 @@ GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
--echo [on slave]
sync_slave_with_master;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
CHANGE MASTER TO master_user='rpl', master_password='rpl';
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;
--echo ==== Do replication as new user ====
--echo [on master]
@@ -53,8 +51,7 @@ sync_slave_with_master;
--echo ==== Restart slave without privileges =====
# (slave.err will contain access denied error for this START SLAVE command)
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index 0c9245a7265..ec6464fb095 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -11,6 +11,7 @@
source include/have_binlog_format_mixed.inc;
source include/master-slave.inc;
+
# we need a db != test, where we don't have automatic grants
--disable_warnings
drop database if exists mysqltest1;
@@ -240,6 +241,8 @@ begin
end|
delimiter ;|
connection master;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
# test old variable name:
set global log_bin_trust_routine_creators=1;
# now use new name:
@@ -247,6 +250,8 @@ set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
# slave needs it too otherwise will not execute what master allowed:
connection slave;
+set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
+set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
connection con1;
@@ -571,9 +576,12 @@ show binlog events in 'master-bin.000001' from 106;
# Restore log_bin_trust_function_creators to its original value.
# This is a cleanup for all parts above where we tested stored
# functions and triggers.
-set global log_bin_trust_function_creators=0;
+connection slave;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
connection master;
-set global log_bin_trust_function_creators=0;
+set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
+set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# Clean up
drop database mysqltest;
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index c1092e3260f..63ac3a8ad9c 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -10,6 +10,8 @@
# ****************************************************************
connection master;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
+
# cleanup
--disable_warnings
drop procedure if exists p1;
@@ -254,8 +256,8 @@ drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
-sync_slave_with_master;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
-SET GLOBAL log_bin_trust_function_creators = 0;
+sync_slave_with_master;
--echo end of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 2793e8833fd..bc0b647bc73 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -8,12 +8,8 @@ let $VERSION=`select version()`;
# stop slave before he will start replication also sync with master
# for avoiding undetermenistic behaviour
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+sync_slave_with_master;
+--source include/stop_slave.inc
connection master;
# create some events on master
@@ -49,12 +45,8 @@ source include/show_slave_status2.inc;
# clean up
start slave;
connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
-# Make sure the slave sql and io thread has stopped
---source include/wait_for_slave_to_stop.inc
+sync_slave_with_master;
+--source include/stop_slave.inc
# this should stop immediately as we are already there
start slave until master_log_file='master-bin.000001', master_log_pos=776;