summaryrefslogtreecommitdiff
path: root/mysql-test/suite/multi_source
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-12-29 13:23:18 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-29 13:23:18 +0100
commit4a5d25c338a5d1d2cc16343380193d6bf25ae6ae (patch)
tree73b84a9c8f3d5e3e3383fa79465b11f9ded512d3 /mysql-test/suite/multi_source
parent48dc7cc66ef5b69fcf28ec0b2ecf0338c188cf4e (diff)
parentc13b5011629b5ff7b969d648265002e4d1ba94c2 (diff)
downloadmariadb-git-4a5d25c338a5d1d2cc16343380193d6bf25ae6ae.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'mysql-test/suite/multi_source')
-rw-r--r--mysql-test/suite/multi_source/gtid.test8
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.test8
-rw-r--r--mysql-test/suite/multi_source/info_logs.test6
-rw-r--r--mysql-test/suite/multi_source/load_data.test6
-rw-r--r--mysql-test/suite/multi_source/multisource.test292
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.test4
-rw-r--r--mysql-test/suite/multi_source/reset_master_slave.inc29
-rw-r--r--mysql-test/suite/multi_source/reset_slave.test4
-rw-r--r--mysql-test/suite/multi_source/simple.test6
-rw-r--r--mysql-test/suite/multi_source/skip_counter.test6
-rw-r--r--mysql-test/suite/multi_source/status_vars.test6
-rw-r--r--mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc6
12 files changed, 28 insertions, 353 deletions
diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test
index bebee66068f..c81ca20a254 100644
--- a/mysql-test/suite/multi_source/gtid.test
+++ b/mysql-test/suite/multi_source/gtid.test
@@ -150,22 +150,22 @@ SET GLOBAL gtid_domain_id=0;
--source include/wait_condition.inc
--sorted_result
STOP ALL SLAVES;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave1
--connection slave2
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave2
--connection master1
SET GLOBAL gtid_domain_id=0;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
SET GLOBAL gtid_domain_id=0;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
index 4d98b5c2ee7..218d91aa7fb 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
@@ -431,20 +431,20 @@ SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
--connection server_1
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_1
--connection server_2
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_2
--connection server_3
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_3
--connection server_4
DROP TABLE t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect server_4
diff --git a/mysql-test/suite/multi_source/info_logs.test b/mysql-test/suite/multi_source/info_logs.test
index 2aaaf14c919..ef504e06a2f 100644
--- a/mysql-test/suite/multi_source/info_logs.test
+++ b/mysql-test/suite/multi_source/info_logs.test
@@ -187,14 +187,14 @@ show all slaves status;
# Cleanup
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/load_data.test b/mysql-test/suite/multi_source/load_data.test
index ca2391a9c8d..94b328d56ae 100644
--- a/mysql-test/suite/multi_source/load_data.test
+++ b/mysql-test/suite/multi_source/load_data.test
@@ -61,11 +61,11 @@ drop table t2;
--sorted_result
stop all slaves;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index dfeefe9a1d3..fc58fe81803 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -1,291 +1 @@
-#
-# Test basic replication functionality
-# in multi-source setup
-#
-
---source include/not_embedded.inc
---source include/have_innodb.inc
---source include/binlog_start_pos.inc
---let $rpl_server_count= 0
-
---connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
-
-# MDEV-3984: crash/read of freed memory when changing master with named connection
-# This fails after adding the new master 'abc', check we do not free twice.
---error ER_RELAY_LOG_INIT
-change master 'abc' to relay_log_file='';
-# This fails before adding the new master, check that we do free it.
---error ER_WRONG_ARGUMENTS
-change master 'abc2' to master_host='';
-
-
-# Start replication from the first master
-
---replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'master1' to
-master_port=$SERVER_MYPORT_1,
-master_host='127.0.0.1',
-master_user='root';
-
-start slave 'master1';
-set default_master_connection = 'master1';
---source include/wait_for_slave_to_start.inc
-
---connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
---save_master_pos
-
---connection slave
---sync_with_master 0,'master1'
-
-# Here and further: add an extra check on SQL thread status
-# as the normal sync is not always enough
---source wait_for_sql_thread_read_all.inc
-
-# each of the 3 commands should produce
-# 'master1' status
-
-let $wait_for_all= 1;
-let $show_statement= SHOW ALL SLAVES STATUS;
-let $field= Slave_IO_State;
-let $condition= = 'Waiting for master to send event';
---source include/wait_show_condition.inc
-
---echo #
---echo # Checking SHOW SLAVE 'master1' STATUS
---echo #
---let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
---let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
---let $slave_name= 'master1'
---source include/show_slave_status.inc
---let $slave_name=
-
---echo #
---echo # Checking SHOW SLAVE STATUS
---echo #
---source include/show_slave_status.inc
-
---echo #
---echo # Checking SHOW ALL SLAVES STATUS
---echo #
---let $all_slaves_status= 1
---let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
---source include/show_slave_status.inc
---let $all_slaves_status=
---echo #
-
-
-# Check that replication actually works
-
---connection master1
-
---disable_warnings
-drop database if exists db1;
---enable_warnings
-create database db1;
-use db1;
-create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
-insert into t1 (f1) values ('one'),('two');
---save_master_pos
-
---connection slave
---sync_with_master 0,'master1'
-
---sorted_result
-select * from db1.t1;
-
---let $datadir = `SELECT @@datadir`
-
---echo # List of relay log files in the datadir
---list_files $datadir mysqld-relay-bin-master1.*
-
-# Check that relay logs are recognizable
-
-let binlog_start=4;
-let binlog_file=;
-source include/show_relaylog_events.inc;
-let binlog_file= mysqld-relay-bin-master1.000002;
-source include/show_relaylog_events.inc;
-
-# Try to configure connection with the same name again,
-# should get an error because the slave is running
-
---replace_result $SERVER_MYPORT_2 MYPORT_2
---error ER_SLAVE_MUST_STOP
-eval change master 'master1' to
-master_port=$SERVER_MYPORT_2,
-master_host='127.0.0.1',
-master_user='root';
-
-# Try to configure using the default connection name
-# (which is 'master1' at the moment),
-# again, should get an error
-
---replace_result $SERVER_MYPORT_2 MYPORT_2
---error ER_SLAVE_MUST_STOP
-eval change master to
-master_port=$SERVER_MYPORT_2,
-master_host='127.0.0.1',
-master_user='root';
-
-# Try to configure a connection with the same master
-# using a different name, should get a conflict
-
---replace_result $SERVER_MYPORT_1 MYPORT_1
---error ER_CONNECTION_ALREADY_EXISTS
-eval change master 'master2' to
-master_port=$SERVER_MYPORT_1,
-master_host='127.0.0.1',
-master_user='root';
-
-
-# Set up a proper 'default' connection to master2
-
-set default_master_connection = '';
-
---replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master to
-master_port=$SERVER_MYPORT_2,
-master_host='127.0.0.1',
-master_user='root';
-
-start slave;
---source include/wait_for_slave_to_start.inc
-
---source wait_for_sql_thread_read_all.inc
-
-# See both connections in the same status output
-
-let $wait_for_all= 1;
-let $show_statement= SHOW ALL SLAVES STATUS;
-let $field= Slave_IO_State;
-let $condition= = 'Waiting for master to send event';
---source include/wait_show_condition.inc
-
---echo #
---echo # Checking SHOW ALL SLAVES STATUS
---echo #
---let $all_slaves_status= 1
---let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
---let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
---source include/show_slave_status.inc
---let $all_slaves_status=
---echo #
-
-# Check that replication from two servers actually works
-
---connection master1
-
-insert into t1 (f1) values ('three');
---save_master_pos
-
---connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
-
---disable_warnings
-drop database if exists db2;
---enable_warnings
-create database db2;
-use db2;
-create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
-begin;
-insert into t1 (f1) values (1),(2);
-
---connection slave
---sync_with_master 0,'master1'
-
---connection master2
---save_master_pos
-
---connection slave
---sync_with_master 0
---sorted_result
-select * from db1.t1;
-select * from db2.t1;
-
---connection master2
-commit;
---save_master_pos
-
---connection slave
---sync_with_master 0
---sorted_result
-select * from db2.t1;
-
-# Flush and purge logs on one master,
-# make sure slaves don't get confused
-
---connection master1
-flush logs;
---source include/wait_for_binlog_checkpoint.inc
---save_master_pos
---connection slave
---sync_with_master 0, 'master1'
-
---connection master1
-purge binary logs to 'master-bin.000002';
-let filesize=`select $binlog_start_pos+131`;
---replace_result $filesize filesize
-show binary logs;
-insert into t1 (f1) values ('four');
-create table db1.t3 (f1 int) engine=InnoDB;
---save_master_pos
-
---connection slave
---sync_with_master 0,'master1'
-
---source wait_for_sql_thread_read_all.inc
-
-let $wait_for_all= 1;
-let $show_statement= SHOW ALL SLAVES STATUS;
-let $field= Slave_IO_State;
-let $condition= = 'Waiting for master to send event';
---source include/wait_show_condition.inc
-
---echo #
---echo # Checking SHOW ALL SLAVES STATUS
---echo #
---let $all_slaves_status= 1
---let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
---let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
---source include/show_slave_status.inc
---let $all_slaves_status=
---echo #
-
---sorted_result
-select * from db1.t1;
-
-# This should show relay log events for the default master
-# (the one with the empty name)
-let binlog_file=;
-source include/show_relaylog_events.inc;
-let binlog_file= mysqld-relay-bin.000002;
-source include/show_relaylog_events.inc;
-
-# Make sure we don't lose control over replication connections
-# after reconnecting to the slave
-
---disconnect slave
---connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
-
-stop slave io_thread;
-show status like 'Slave_running';
-set default_master_connection = 'master1';
-show status like 'Slave_running';
-
-# Cleanup
-
-drop database db1;
-drop database db2;
-
---source reset_master_slave.inc
---disconnect slave
-
---connection master1
-drop database db1;
---source reset_master_slave.inc
---disconnect master1
-
---connection master2
-drop database db2;
---source reset_master_slave.inc
---disconnect master2
-
+--source extra/rpl_tests/multisource.inc
diff --git a/mysql-test/suite/multi_source/relaylog_events.test b/mysql-test/suite/multi_source/relaylog_events.test
index 18e92c32e8e..7e5257af837 100644
--- a/mysql-test/suite/multi_source/relaylog_events.test
+++ b/mysql-test/suite/multi_source/relaylog_events.test
@@ -44,10 +44,10 @@ drop table t1;
--connection slave
--sync_with_master 0,'master1'
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
diff --git a/mysql-test/suite/multi_source/reset_master_slave.inc b/mysql-test/suite/multi_source/reset_master_slave.inc
deleted file mode 100644
index af66da2bb8b..00000000000
--- a/mysql-test/suite/multi_source/reset_master_slave.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# The include file runs RESET ALL for every replication connection
-# currently present in SHOW FULL SLAVE STATUS output on the server,
-# and also runs RESET MASTER on the same server.
-#
-
---let $include_filename= reset_master_slave.inc
---source include/begin_include_file.inc
-
---disable_query_log
---disable_result_log
---disable_warnings
---let $default_master = `SELECT @@default_master_connection`
---let $con_name = query_get_value(show all slaves status, Connection_name, 1)
-while ($con_name != 'No such row')
-{
- eval set default_master_connection = '$con_name';
- stop slave;
- --source include/wait_for_slave_to_stop.inc
- reset slave all;
- --let $con_name = query_get_value(show all slaves status, Connection_name, 1)
-}
-
---error 0,ER_FLUSH_MASTER_BINLOG_CLOSED
-reset master;
-set global gtid_slave_pos='';
-eval set default_master_connection = '$default_master';
---source include/end_include_file.inc
-
diff --git a/mysql-test/suite/multi_source/reset_slave.test b/mysql-test/suite/multi_source/reset_slave.test
index f708a71d6de..63a1f9c3490 100644
--- a/mysql-test/suite/multi_source/reset_slave.test
+++ b/mysql-test/suite/multi_source/reset_slave.test
@@ -61,12 +61,12 @@ show slave 'master1' status;
# Cleanup
drop table t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
drop table t1;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
diff --git a/mysql-test/suite/multi_source/simple.test b/mysql-test/suite/multi_source/simple.test
index 8260686e927..95291c53778 100644
--- a/mysql-test/suite/multi_source/simple.test
+++ b/mysql-test/suite/multi_source/simple.test
@@ -75,12 +75,12 @@ stop all slaves;
# clean up
#
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/skip_counter.test b/mysql-test/suite/multi_source/skip_counter.test
index 937261350a8..e53d0276a91 100644
--- a/mysql-test/suite/multi_source/skip_counter.test
+++ b/mysql-test/suite/multi_source/skip_counter.test
@@ -134,16 +134,16 @@ drop database db;
--eval set global max_relay_log_size = $max_relay_log_size_saved
--eval set global max_binlog_size = $max_binlog_size_saved
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
drop database db;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
drop database db;
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/status_vars.test b/mysql-test/suite/multi_source/status_vars.test
index d1cfda75d01..e76a403db33 100644
--- a/mysql-test/suite/multi_source/status_vars.test
+++ b/mysql-test/suite/multi_source/status_vars.test
@@ -127,13 +127,13 @@ show status like 'Slave_open_temp_tables';
# Cleanup
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect slave
--connection master1
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master1
--connection master2
---source reset_master_slave.inc
+--source include/reset_master_slave.inc
--disconnect master2
diff --git a/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc b/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc
deleted file mode 100644
index ec5ecd0cb17..00000000000
--- a/mysql-test/suite/multi_source/wait_for_sql_thread_read_all.inc
+++ /dev/null
@@ -1,6 +0,0 @@
---let $show_statement = show all slaves status
---let $field = Slave_SQL_State
---let $condition = = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
---let $wait_for_all = 1
---source include/wait_show_condition.inc
-