summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-10-22 13:27:18 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-10-22 13:27:18 +0300
commit46957a6a77518b579c6c8e1345666f84a5a59455 (patch)
treec0e463f14123cd09bb4d5854d32577e44b3a9827 /mysql-test/suite/rpl
parent1619ae899099c4934f3b5919b2398c95a7cacc94 (diff)
parente3d692aa092a76415ce1ce0e9662338873d84abb (diff)
downloadmariadb-git-46957a6a77518b579c6c8e1345666f84a5a59455.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r--mysql-test/suite/rpl/disabled.def1
-rw-r--r--mysql-test/suite/rpl/r/rpl_mysql_upgrade.result58
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_stop_slave.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_mysql_upgrade.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_stop_slave.test5
7 files changed, 96 insertions, 19 deletions
diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def
index 9e52c277726..89140a19ac8 100644
--- a/mysql-test/suite/rpl/disabled.def
+++ b/mysql-test/suite/rpl/disabled.def
@@ -16,6 +16,5 @@ rpl_partition_archive : MDEV-5077 2013-09-27 svoj Cannot exchange partition
rpl_row_binlog_max_cache_size : MDEV-11092
rpl_row_index_choice : MDEV-11666
rpl_semi_sync_after_sync : fails after MDEV-16172
-rpl_slave_grp_exec: MDEV-10514
rpl_auto_increment_update_failure : disabled for now
rpl_current_user : waits for MDEV-22374 fix
diff --git a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
index 1f352e68bc7..35e5de7b15a 100644
--- a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
+++ b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
@@ -3,20 +3,66 @@ include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("table or database name 'mysqltest-1'");
connection master;
-DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
-CREATE DATABASE `#mysql50#mysqltest-1`;
+CREATE DATABASE `mysqltest-1`;
connection slave;
connection master;
connection slave;
connection master;
Master position is not changed
connection slave;
-STOP SLAVE SQL_THREAD;
-include/wait_for_slave_sql_to_stop.inc
+SET @old_general_log_state = @@global.general_log;
+SET @old_slow_log_state = @@global.slow_query_log;
+SET @old_log_output = @@global.log_output;
+SET GLOBAL general_log = 'ON';
+SET GLOBAL slow_query_log = 'ON';
+SET GLOBAL log_output = 'FILE';
+connection master;
+ALTER TABLE mysql.slow_log DROP COLUMN thread_id, DROP COLUMN rows_affected;
+DROP DATABASE `mysqltest-1`;
+connection slave;
+connection slave;
+SHOW CREATE TABLE mysql.slow_log;
+Table Create Table
+slow_log CREATE TABLE `slow_log` (
+ `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
+ `user_host` mediumtext NOT NULL,
+ `query_time` time(6) NOT NULL,
+ `lock_time` time(6) NOT NULL,
+ `rows_sent` int(11) NOT NULL,
+ `rows_examined` int(11) NOT NULL,
+ `db` varchar(512) NOT NULL,
+ `last_insert_id` int(11) NOT NULL,
+ `insert_id` int(11) NOT NULL,
+ `server_id` int(10) unsigned NOT NULL,
+ `sql_text` mediumtext NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
connection master;
connection master;
Master position has been changed
-DROP DATABASE `mysqltest-1`;
connection slave;
-DROP DATABASE `#mysql50#mysqltest-1`;
+connection slave;
+SHOW CREATE TABLE mysql.slow_log;
+Table Create Table
+slow_log CREATE TABLE `slow_log` (
+ `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
+ `user_host` mediumtext NOT NULL,
+ `query_time` time(6) NOT NULL,
+ `lock_time` time(6) NOT NULL,
+ `rows_sent` int(11) NOT NULL,
+ `rows_examined` int(11) NOT NULL,
+ `db` varchar(512) NOT NULL,
+ `last_insert_id` int(11) NOT NULL,
+ `insert_id` int(11) NOT NULL,
+ `server_id` int(10) unsigned NOT NULL,
+ `sql_text` mediumtext NOT NULL,
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
+SET GLOBAL general_log = 'OFF';
+SET GLOBAL slow_query_log = 'OFF';
+truncate mysql.slow_log;
+truncate mysql.general_log;
+SET GLOBAL general_log = @old_general_log_state;
+SET GLOBAL slow_query_log = @old_slow_log_state;
+SET GLOBAL log_output = @old_log_output;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
index c0140962a56..e0272b71192 100644
--- a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
@@ -5,10 +5,12 @@ set @time_before_kill := (select CURRENT_TIMESTAMP);
[Time before the query]
[Connection ID of the slave I/O thread found]
kill <connection_id>;
+include/wait_for_slave_io_to_stop.inc
set @time_after_kill := (select CURRENT_TIMESTAMP);
[Time after the query]
[Killing of the slave IO thread was successful]
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
connection master;
create table t1 (a int primary key);
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test b/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test
index 622e66c5263..0262998798a 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_delete_domain.test
@@ -55,8 +55,17 @@ FLUSH BINARY LOGS;
--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
--eval PURGE BINARY LOGS TO '$purge_to_binlog';
# with final removal of the extra domain
+###adding to debug info to catch the failure (1076):
+--error 0,1076
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID=($extra_domain_id)
+
+if ($mysql_errno == 1076) {
+ --echo ### Failure "Could not delete gtid domain"
+ --source include/show_rpl_debug_info.inc
+ }
+
SELECT @@global.gtid_binlog_pos, @@global.gtid_binlog_state;
+
--connection slave
SELECT @@global.gtid_slave_pos;
# start the slave sucessfully
diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
index 1931e2eab2a..f44c883ef4e 100644
--- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
+++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
@@ -14,8 +14,7 @@ call mtr.add_suppression("table or database name 'mysqltest-1'");
connection master;
--disable_warnings
-DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
-CREATE DATABASE `#mysql50#mysqltest-1`;
+CREATE DATABASE `mysqltest-1`;
--enable_warnings
sync_slave_with_master;
@@ -34,13 +33,25 @@ if ($before_position == $after_position)
echo Master position is not changed;
}
-#Some log events of the mysql_upgrade's will cause errors on slave.
+# Some log events of the mysql_upgrade previously caused errors on slave,
+# however with MDEV-4851 this should be ok, so we test it:
connection slave;
-STOP SLAVE SQL_THREAD;
-source include/wait_for_slave_sql_to_stop.inc;
+SET @old_general_log_state = @@global.general_log;
+SET @old_slow_log_state = @@global.slow_query_log;
+SET @old_log_output = @@global.log_output;
+SET GLOBAL general_log = 'ON';
+SET GLOBAL slow_query_log = 'ON';
+SET GLOBAL log_output = 'FILE';
connection master;
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
+ALTER TABLE mysql.slow_log DROP COLUMN thread_id, DROP COLUMN rows_affected;
+DROP DATABASE `mysqltest-1`;
+sync_slave_with_master;
+
+connection slave;
+SHOW CREATE TABLE mysql.slow_log;
+connection master;
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
let $datadir= `select @@datadir`;
@@ -55,8 +66,15 @@ if ($before_position != $after_position)
echo Master position has been changed;
}
-DROP DATABASE `mysqltest-1`;
+sync_slave_with_master;
connection slave;
-DROP DATABASE `#mysql50#mysqltest-1`;
---let $rpl_only_running_threads= 1
+SHOW CREATE TABLE mysql.slow_log;
+SET GLOBAL general_log = 'OFF';
+SET GLOBAL slow_query_log = 'OFF';
+truncate mysql.slow_log;
+truncate mysql.general_log;
+SET GLOBAL general_log = @old_general_log_state;
+SET GLOBAL slow_query_log = @old_slow_log_state;
+SET GLOBAL log_output = @old_log_output;
+
--source include/rpl_end.inc
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 928ad7e5e09..9fc8f1320f7 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -101,7 +101,9 @@ TRUNCATE t3;
ALTER TABLE t1 ADD PRIMARY KEY (a);
ALTER TABLE t2 ADD PRIMARY KEY (a);
ALTER TABLE t3 ADD PRIMARY KEY (a);
---sync_slave_with_master
+
+#--sync_slave_with_master
+--connection slave
RENAME TABLE t3 TO t3_bak;
--connection master
@@ -146,7 +148,7 @@ ALTER TABLE t1 ENGINE=InnoDB;
ALTER TABLE t2 ENGINE=InnoDB;
ALTER TABLE t3 ENGINE=InnoDB;
---connection slave
+--sync_slave_with_master
RENAME TABLE t3 TO t3_bak;
--connection master
diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
index a38ac8fc6a1..23b25b1bf85 100644
--- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
@@ -38,8 +38,8 @@ set @time_before_kill := (select CURRENT_TIMESTAMP);
--replace_regex /kill [0-9]*/kill <connection_id>/
--eval kill $connection_id
-let $wait_condition= SELECT COUNT(*) = 0 FROM information_schema.processlist where id=$connection_id;
---source include/wait_condition.inc
+--source include/wait_for_slave_io_to_stop.inc
+
set @time_after_kill := (select CURRENT_TIMESTAMP);
--echo [Time after the query]
@@ -52,6 +52,7 @@ if(`select TIMESTAMPDIFF(SECOND,@time_after_kill, @time_before_kill) > 60`)
--echo [Killing of the slave IO thread was successful]
START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
# Ensure that the slave io thread started properly
connection master;