summaryrefslogtreecommitdiff
path: root/mysql-test/include/master-slave.inc
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include/master-slave.inc')
-rw-r--r--mysql-test/include/master-slave.inc72
1 files changed, 58 insertions, 14 deletions
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index 134bb61ddab..9ed206b2c22 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -1,19 +1,63 @@
-# Replication tests need binlog
+# ==== Purpose ====
#
-# $skip_slave_start If true, the slave will not be started
-source include/have_log_bin.inc;
-
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
+# Configure two servers to be replication master and slave.
+#
+# ==== Usage ====
+#
+# [--let $rpl_server_count= N]
+# [--let $rpl_check_server_ids= 1]
+# [--let $rpl_skip_reset_master_and_slave= 1]
+# [--let $rpl_skip_change_master= 1]
+# [--let $rpl_skip_start_slave= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/master-slave.inc
+#
+# Parameters:
+# $rpl_check_server_ids, $rpl_skip_reset_master_and_slave,
+# $rpl_skip_change_master, $rpl_skip_start_slave, $rpl_debug,
+# $slave_timeout
+# See include/rpl_init.inc
+#
+# $rpl_server_count
+# By default, two servers are configured. You can configure more
+# servers (servers 3, 4, etc are neither masters nor slaves) by
+# setting this variable. See also include/rpl_init.inc
--- source include/master-slave-reset.inc
-if (!$skip_slave_start) {
- connection master;
- sync_slave_with_master;
+--let $include_filename= master-slave.inc
+if ($rpl_server_count)
+{
+ --let $include_filename= master-slave.inc [rpl_server_count=$rpl_server_count]
}
+--source include/begin_include_file.inc
+
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= master1
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave1
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+
+--let $include_filename= master-slave.inc
+--source include/end_include_file.inc
+
-# Set the default connection to 'master'
-connection master;
+# Set the default connection to 'master'. Do this after
+# end_include_file.inc, so that it gets printed to the query log.
+--let $rpl_connection_name= master
+--source include/rpl_connection.inc