1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.4' into 10.5

This commit is contained in:
Sergei Golubchik
2023-12-01 13:43:58 +01:00
511 changed files with 26233 additions and 3853 deletions

View File

@@ -36,7 +36,8 @@ insert into t1 values (3);
--connection slave
--source include/start_slave.inc
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)' and command LIKE 'Slave_worker';
# Wildcard for `state` as it depends on whether WSREP is compiled in or not.
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker';
--source include/wait_condition.inc
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit%' and command LIKE 'Slave_worker';
--source include/wait_condition.inc
@@ -50,8 +51,8 @@ insert into t1 values (3);
commit;
--connection slave
--let $slave_timeout=1032
--source include/wait_for_slave_sql_to_stop.inc
--let $slave_sql_errno=1032
--source include/wait_for_slave_sql_error.inc
update t1 set a=1 where a=2;
set @@global.slave_parallel_threads = @save.slave_parallel_threads;

View File

@@ -55,7 +55,8 @@ drop table t2;
--source include/start_slave.inc
--echo # wait for T1
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)' and command LIKE 'Slave_worker';
# Wildcard for `state` as it depends on whether WSREP is compiled in or not.
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker';
--source include/wait_condition.inc
--echo # wait for T2
@@ -75,8 +76,8 @@ drop table t2;
commit;
--connection slave
--let $slave_timeout=1032
--source include/wait_for_slave_sql_to_stop.inc
--let $slave_sql_errno=1032
--source include/wait_for_slave_sql_error.inc
update t1 set a=1 where a=2;
set @@global.slave_parallel_threads = @save.slave_parallel_threads;

View File

@@ -411,6 +411,8 @@ while ($n)
COMMIT;
--connection slave
# Multi-statement transaction raised ER_TRANS_CACHE_FULL (4096=128x32)
# that will stop SQL slave thread
--let $slave_sql_errno= 1197
if (`SELECT @@binlog_format = 'ROW'`)
{
@@ -430,7 +432,8 @@ source include/show_binlog_events.inc;
--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
source include/stop_slave.inc;
# SQL slave is stopped, stop only IO thread
source include/stop_slave_io.inc;
source include/start_slave.inc;
connection master;

View File

@@ -75,17 +75,22 @@ EOF
--connection server_1
DROP TABLE t1;
# Slaves IO thread will receive the disconnect error when master was shutdown
# so we are allowing error on start.
--connection server_2
--disable_warnings
--let rpl_allow_error=1
--source include/start_slave.inc
--enable_warnings
--connection server_3
--disable_warnings
--let rpl_allow_error=1
--source include/start_slave.inc
--enable_warnings
--connection server_4
--disable_warnings
--let rpl_allow_error=1
--source include/start_slave.inc
--enable_warnings

View File

@@ -207,7 +207,7 @@ START SLAVE;
--let $status_items= Last_IO_Errno, Last_IO_Error
--source include/show_slave_status.inc
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
RESET SLAVE;
--connection master

View File

@@ -82,7 +82,9 @@ connection slave;
# slave will catch the killed status, won't shut down immediately
# but does it eventually having the whole group unfinished (not committed)
source include/wait_for_slave_sql_to_stop.inc;
# ER_SLAVE_FATAL_ERROR
--let slave_sql_errno= 1593
source include/wait_for_slave_sql_error.inc;
# checking: the error and group unfinished
@@ -120,7 +122,8 @@ connection slave;
# but does it eventually having the whole group unfinished (not committed)
#
source include/wait_for_slave_sql_to_stop.inc;
--let slave_sql_errno= 1593
source include/wait_for_slave_sql_error.inc;
# checking: the error and group unfinished

View File

@@ -42,7 +42,8 @@ include/save_master_gtid.inc
connection slave;
#
# Cleanup
include/stop_slave.inc
include/wait_for_slave_sql_to_stop.inc
include/stop_slave_io.inc
set @@global.slave_parallel_threads= 0;
set @@global.slave_parallel_mode= optimistic;
set @@global.innodb_lock_wait_timeout= 50;

View File

@@ -72,8 +72,6 @@ include/stop_slave.inc
# Normal XA ROLLBACK
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
connection master;
connection aux_slave;
BEGIN;
@@ -109,8 +107,6 @@ include/stop_slave.inc
# Errored out XA COMMIT
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
connection master;
connection aux_slave;
BEGIN;

View File

@@ -75,8 +75,6 @@ include/stop_slave.inc
# Normal XA ROLLBACK
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
connection master;
connection aux_slave;
BEGIN;
@@ -112,8 +110,6 @@ include/stop_slave.inc
# Errored out XA COMMIT
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
connection master;
connection aux_slave;
BEGIN;

View File

@@ -75,8 +75,6 @@ include/stop_slave.inc
# Normal XA ROLLBACK
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
connection master;
connection aux_slave;
BEGIN;
@@ -112,8 +110,6 @@ include/stop_slave.inc
# Errored out XA COMMIT
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
connection master;
connection aux_slave;
BEGIN;

View File

@@ -0,0 +1,38 @@
include/master-slave.inc
[connection master]
connection master;
SET @save_binlog_stmt_cache_size= @@GLOBAL.binlog_stmt_cache_size;
SET GLOBAL binlog_stmt_cache_size= 4096;
CALL mtr.add_suppression('"No space left on device".*An incident event is written to binary log');
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=MyISAM;
FLUSH STATUS;
SHOW STATUS LIKE "binlog_stmt_cache%";
Variable_name Value
Binlog_stmt_cache_disk_use 0
Binlog_stmt_cache_use 0
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,load_data_binlog_cache_error";
LOAD DATA CONCURRENT LOCAL INFILE 'std_data/bug30435_5k.txt'
REPLACE INTO TABLE t1 (a);
ERROR HY000: Error writing file '<FILENAME>' (Errcode: 28 "No space left on device")
SET SESSION debug_dbug= @old_dbug;
SHOW STATUS LIKE "binlog_stmt_cache%";
Variable_name Value
Binlog_stmt_cache_disk_use 1
Binlog_stmt_cache_use 1
SELECT IF(COUNT(*) > 0 AND COUNT(*) < 5000,
"ok",
CONCAT("ERROR! Row count ", COUNT(*), " not as expected for partially executed query"))
AS check_result
FROM t1;
check_result
ok
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
SELECT COUNT(*) FROM t1;
COUNT(*)
0
connection master;
SET GLOBAL binlog_stmt_cache_size= @save_binlog_stmt_cache_size;
DROP TABLE t1;
include/rpl_end.inc

View File

@@ -0,0 +1,51 @@
include/master-slave.inc
[connection master]
connection master;
SET @save_binlog_stmt_cache_size= @@GLOBAL.binlog_stmt_cache_size;
SET GLOBAL binlog_stmt_cache_size= 4096;
CALL mtr.add_suppression('"No space left on device".*An incident event is written to binary log');
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(255)) ENGINE=MyISAM;
FLUSH STATUS;
SHOW STATUS LIKE "binlog_stmt_cache%";
Variable_name Value
Binlog_stmt_cache_disk_use 0
Binlog_stmt_cache_use 0
INSERT INTO t1 VALUES (0, CONCAT("?", "-", REPEAT("x", 200)));
INSERT INTO t1 SELECT a+1, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+2, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+4, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+8, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+16, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+32, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+64, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+128, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
SHOW STATUS LIKE "binlog_stmt_cache%";
Variable_name Value
Binlog_stmt_cache_disk_use 2
Binlog_stmt_cache_use 9
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,simulate_disk_full_at_flush_pending";
INSERT INTO t1 SELECT a+256, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
ERROR HY000: Error writing file '<FILENAME>' (Errcode: 28 "No space left on device")
SET SESSION debug_dbug= @old_dbug;
SHOW STATUS LIKE "binlog_stmt_cache%";
Variable_name Value
Binlog_stmt_cache_disk_use 3
Binlog_stmt_cache_use 10
SELECT IF(COUNT(*) > 256 AND COUNT(*) < 512,
"ok",
CONCAT("ERROR! Row count ", COUNT(*), " not as expected for partially executed query"))
AS check_result
FROM t1;
check_result
ok
ALTER TABLE t1 COMMENT '<mumble>';
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
SELECT COUNT(*) FROM t1;
COUNT(*)
256
connection master;
SET GLOBAL binlog_stmt_cache_size= @save_binlog_stmt_cache_size;
DROP TABLE t1;
include/rpl_end.inc

View File

@@ -6,7 +6,7 @@ include/stop_slave.inc
CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= '';
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1045, 1593]
include/stop_slave.inc
include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
START SLAVE;
include/rpl_end.inc

View File

@@ -135,7 +135,7 @@ i
2
3
SET @@global.debug_dbug=@saved_dbug;
include/stop_slave.inc
include/stop_slave_sql.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) :
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
@@ -204,7 +204,7 @@ i
10
11
SET @@global.debug_dbug=@saved_dbug;
include/stop_slave.inc
include/stop_slave_sql.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) : 1
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
@@ -287,7 +287,7 @@ i
16
17
SET @@global.debug_dbug=@saved_dbug;
include/stop_slave.inc
include/stop_slave_sql.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) : 1
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
@@ -384,7 +384,7 @@ i
22
23
SET @@global.debug_dbug=@saved_dbug;
include/stop_slave.inc
include/stop_slave_sql.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) :
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;

View File

@@ -38,8 +38,8 @@ connection master;
include/rpl_start_server.inc [server_number=1]
# Master has restarted successfully
connection slave;
include/stop_slave.inc
include/start_slave.inc
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_start.inc
select * from ti;
a
1

View File

@@ -1,14 +1,15 @@
include/master-slave.inc
[connection master]
connection slave;
CALL mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: Debug Induced Error");
set @old_dbug=@@global.debug_dbug;
set global debug_dbug='d,fail_com_register_slave';
stop slave;
reset slave;
include/wait_for_slave_to_stop.inc
start slave;
stop slave;
include/wait_for_slave_to_stop.inc
include/wait_for_slave_io_error.inc [errno=1597]
include/stop_slave_sql.inc
set global debug_dbug=@old_dbug;
connection master;
kill DUMP_THREAD;

View File

@@ -52,7 +52,7 @@ Waiting until 'Slave_IO_Running' = 'Yes' [$slave_error_param='Last_IO_Errno']
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
...==== BEGIN include/wait_for_slave_param.inc [Slave_SQL_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
Waiting until 'Slave_SQL_Running' = 'Yes' [$slave_error_param='1']
Waiting until 'Slave_SQL_Running' = 'Yes' [$slave_error_param='']
[connection slave]
...==== END include/wait_for_slave_param.inc [Slave_SQL_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'

View File

@@ -23,7 +23,8 @@ INSERT INTO t1 VALUES (2);
SET sql_log_bin=1;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1062]
include/stop_slave.inc
include/wait_for_slave_io_to_start.inc
include/stop_slave_io.inc
SET GLOBAL gtid_slave_pos= "0-1-100";
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
@@ -39,7 +40,7 @@ REPLACE INTO t1 VALUES (5);
SET debug_dbug= @dbug_save;
connection slave;
include/wait_for_slave_sql_error.inc [errno=1590]
include/stop_slave.inc
include/stop_slave_io.inc
SET sql_slave_skip_counter=1;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;

View File

@@ -36,7 +36,7 @@ CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1236]
include/stop_slave.inc
include/stop_slave_sql.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_LOG_FILE="master-bin.000003", MASTER_LOG_POS=4;
include/start_slave.inc

View File

@@ -226,7 +226,7 @@ connection slave;
call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
include/stop_slave.inc
include/stop_slave_io.inc
DROP TABLE t1;
*** Master send to slave ***

View File

@@ -45,14 +45,14 @@ BEGIN
UPDATE t12 SET c = '';
UPDATE t13 SET c = '';
END|
CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO
CREATE EVENT e1 ON SCHEDULE EVERY 10 SECOND DISABLE DO
BEGIN
ALTER EVENT e1 DISABLE;
CALL p1(10, '');
END|
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND DISABLE DO
CREATE EVENT e11 ON SCHEDULE EVERY 10 SECOND DISABLE DO
BEGIN
ALTER EVENT e11 DISABLE;
CALL p11(10, '');

View File

@@ -29,8 +29,7 @@ SELECT * FROM t1;
a b c
1 1 1
2 2 3
stop slave;
include/wait_for_slave_to_stop.inc
include/stop_slave_io.inc
reset slave;
connection master;
reset master;
@@ -189,8 +188,7 @@ SELECT * FROM t1;
a b c
1 1 1
2 2 3
stop slave;
include/wait_for_slave_to_stop.inc
include/stop_slave_io.inc
reset slave;
connection master;
reset master;

View File

@@ -192,7 +192,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/stop_slave_io.inc
include/start_slave.inc
connection master;
connection slave;

View File

@@ -35,7 +35,8 @@ connection server_2;
connection con_temp2;
COMMIT;
connection server_2;
include/stop_slave.inc
include/wait_for_slave_sql_error.inc [errno=1062]
include/stop_slave_io.inc
include/assert.inc [table t1 should have zero rows where a>32]
SELECT * FROM t1 WHERE a>32;
a

View File

@@ -30,7 +30,7 @@ kill $t3_tid;
connection slave1;
commit;
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
update t1 set a=1 where a=2;
set @@global.slave_parallel_threads = @save.slave_parallel_threads;
set @@global.slave_parallel_mode = @save.slave_parallel_mode;
@@ -78,7 +78,7 @@ include/wait_for_slave_param.inc [Last_Errno]
connection slave1;
commit;
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
update t1 set a=1 where a=2;
set @@global.slave_parallel_threads = @save.slave_parallel_threads;
set @@global.slave_parallel_mode = @save.slave_parallel_mode;
@@ -127,7 +127,7 @@ include/wait_for_slave_param.inc [Last_Errno]
connection slave1;
commit;
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
update t1 set a=1 where a=2;
set @@global.slave_parallel_threads = @save.slave_parallel_threads;
set @@global.slave_parallel_mode = @save.slave_parallel_mode;

View File

@@ -38,7 +38,6 @@ connection con2;
SET debug_sync='RESET';
connection server_2;
include/wait_for_slave_sql_error.inc [errno=1062]
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
a b
110 1

View File

@@ -191,7 +191,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/stop_slave_io.inc
include/start_slave.inc
connection master;
connection slave;

View File

@@ -14,7 +14,7 @@ connection master;
UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
connection slave;
include/wait_for_slave_sql_error.inc [errno=1593 ]
include/stop_slave.inc
include/stop_slave_io.inc
SET @@global.debug_dbug=@saved_debug;
include/start_slave.inc
connection master;

View File

@@ -89,7 +89,7 @@ b
3
*** slave must stop (Trying to delete a referenced foreing key)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1451]
Last_SQL_Error
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
@@ -114,7 +114,7 @@ connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1452]
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
@@ -139,9 +139,9 @@ a b
insert into ti1 set b=1;
connection master;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
*** slave must stop (Trying to insert a duplicate key)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error
1062
set foreign_key_checks= 0;
@@ -164,7 +164,7 @@ connection master;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -176,7 +176,7 @@ connection master;
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -190,7 +190,7 @@ connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -202,7 +202,7 @@ connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1032]
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';

View File

@@ -51,7 +51,9 @@ ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UN
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
include/stop_slave.inc
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
include/stop_slave_io.inc
RESET SLAVE;
include/start_slave.inc
include/rpl_reset.inc

View File

@@ -14,14 +14,12 @@ connection master;
# Shutdown master
include/rpl_stop_server.inc [server_number=1]
connection slave;
include/stop_slave.inc
include/wait_for_slave_io_error.inc [errno=2003]
# Restart master
include/rpl_start_server.inc [server_number=1]
connection slave;
include/stop_slave.inc
Warnings:
Note 1255 Slave already has been stopped
include/start_slave.inc
include/wait_for_slave_sql_to_start.inc
include/wait_for_slave_io_to_start.inc
connection master;
SET @@GLOBAL.debug_dbug="";
SET @@GLOBAL. rpl_semi_sync_master_enabled = 0;

View File

@@ -32,7 +32,7 @@ connection slave;
include/diff_tables.inc [master:t1, slave:t1]
connection master;
set statement sql_log_bin=0 for call mtr.add_suppression("Read semi-sync reply magic number error");
SET @save_debug_master= @@global.debug;
SET @save_debug_master= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,semisync_corrupt_magic";
insert into t1 values (11);
connection slave;

View File

@@ -14,6 +14,7 @@ RESET SLAVE ALL;
CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
stop slave;
include/wait_for_slave_to_stop.inc
reset slave all;

View File

@@ -4,6 +4,7 @@ connection slave;
START SLAVE;
call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory");
include/wait_for_slave_sql_error.inc [errno=12]
include/wait_for_slave_io_to_start.inc
include/stop_slave_io.inc
RESET SLAVE;
include/rpl_end.inc

View File

@@ -36,7 +36,6 @@ connection slave;
include/stop_slave.inc
START SLAVE;
include/wait_for_slave_sql_to_start.inc
include/wait_for_slave_io_to_stop.inc
==== Verify that Slave IO thread stopped with error ====
include/wait_for_slave_io_error.inc [errno=1045]
==== Cleanup (Note that slave IO thread is not running) ====

View File

@@ -34,6 +34,7 @@ set debug_sync= "now wait_for sql_thread_run_lock_released";
# Validating that Last_SQL_Errno is cleared..
# ..success
set debug_sync= "now signal sql_thread_continue";
# Wait for debug_sync signal to have been received before issuing RESET
set @@global.debug_dbug= @saved_dbug;
set debug_sync= "RESET";
# Cleanup

View File

@@ -14,8 +14,8 @@ insert into t1 values (1);
connection slave;
select * from t1;
t
stop slave;
include/wait_for_slave_to_stop.inc
include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
include/wait_for_slave_to_start.inc

View File

@@ -192,7 +192,7 @@ SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/stop_slave_io.inc
include/start_slave.inc
connection master;
connection slave;

View File

@@ -109,7 +109,7 @@ START SLAVE;
include/wait_for_slave_param.inc [Last_IO_Errno]
Last_IO_Errno = '1236'
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
include/stop_slave.inc
include/stop_slave_sql.inc
RESET SLAVE;
connection master;
RESET MASTER;

View File

@@ -43,7 +43,7 @@ Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction
commit;
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1593]
SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
@@ -63,7 +63,7 @@ set @@global.debug_dbug="d,stop_slave_middle_group,incomplete_group_in_relay_log
connection master;
update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
connection slave;
include/wait_for_slave_sql_to_stop.inc
include/wait_for_slave_sql_error.inc [errno=1593]
SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1

View File

@@ -13,7 +13,7 @@ connection master;
insert into t1 values (1);
reset master;
connection slave;
include/stop_slave.inc
include/stop_slave_sql.inc
reset slave;
include/start_slave.inc
set global rpl_semi_sync_slave_enabled = OFF;

View File

@@ -213,12 +213,19 @@ set @@session.binlog_format=default;
drop temporary table if exists t9;
--connect(con1,localhost,root,,)
--let $conid = `SELECT CONNECTION_ID()`
set session binlog_format=default;
create temporary table t9 (i int);
--echo *** Must be no DROP logged for t9 when there was no CREATE, at disconnect too ***
--disconnect con1
--connection server_1
# The disconnect runs asynchroneously. Wait for it to complete, otherwise the
# DROP TEMPORARY TABLE may not have been binlogged yet when SHOW BINLOG EVENTS
# is run.
--let $wait_condition= SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID=$conid
--source include/wait_condition.inc
--source include/show_binlog_events.inc
# Clean up

View File

@@ -54,7 +54,8 @@ drop table t2;
--source include/start_slave.inc
--echo # wait for T1
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(-1)' and command LIKE 'Slave_worker';
# Wildcard for `state` as it depends on whether WSREP is compiled in or not.
--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Update_rows_log_event::find_row(%)' and command LIKE 'Slave_worker';
--source include/wait_condition.inc
--echo # wait for T2
@@ -81,7 +82,9 @@ DROP TABLE t1;
--connection slave
--echo #
--echo # Cleanup
--source include/stop_slave.inc
--let $rpl_allow_error= 1
--source include/wait_for_slave_sql_to_stop.inc
--source include/stop_slave_io.inc
eval set @@global.slave_parallel_threads= $save_slave_parallel_threads;
eval set @@global.slave_parallel_mode= $save_slave_parallel_mode;
eval set @@global.innodb_lock_wait_timeout= $save_innodb_lock_wait_timeout;

View File

@@ -59,6 +59,7 @@ XA RECOVER;
{
--let $wait_condition= SELECT COUNT(*) = 0 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
--source include/wait_condition.inc
--let $rpl_allow_error=1
}
ROLLBACK;
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for backup lock"
@@ -71,6 +72,7 @@ if (!$slave_ooo_error)
{
--source include/sync_with_master_gtid.inc
}
--let $rpl_only_running_threads= 1
--source include/stop_slave.inc
if ($slave_ooo_error)
{

View File

@@ -0,0 +1,47 @@
--source include/have_binlog_format_statement.inc
--source include/have_debug.inc
--source include/master-slave.inc
--connection master
# Set minimal cache size so smaller transaction can trigger spill to disk.
SET @save_binlog_stmt_cache_size= @@GLOBAL.binlog_stmt_cache_size;
SET GLOBAL binlog_stmt_cache_size= 4096;
CALL mtr.add_suppression('"No space left on device".*An incident event is written to binary log');
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=MyISAM;
FLUSH STATUS;
SHOW STATUS LIKE "binlog_stmt_cache%";
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,load_data_binlog_cache_error";
--replace_regex /Error writing file '[^']+'/Error writing file '<FILENAME>'/
--error 3
LOAD DATA CONCURRENT LOCAL INFILE 'std_data/bug30435_5k.txt'
REPLACE INTO TABLE t1 (a);
SET SESSION debug_dbug= @old_dbug;
SHOW STATUS LIKE "binlog_stmt_cache%";
# The actual number of rows left after the disk full error may change as
# binlog event sizes are modified. So here we just test that we get partial
# update from the last INSERT..SELECT that gets disk full error.
SELECT IF(COUNT(*) > 0 AND COUNT(*) < 5000,
"ok",
CONCAT("ERROR! Row count ", COUNT(*), " not as expected for partially executed query"))
AS check_result
FROM t1;
--save_master_pos
--connection slave
--let $slave_sql_errno= 1590
--source include/wait_for_slave_sql_error_and_skip.inc
--sync_with_master
SELECT COUNT(*) FROM t1;
# Cleanup
--connection master
SET GLOBAL binlog_stmt_cache_size= @save_binlog_stmt_cache_size;
DROP TABLE t1;
--source include/rpl_end.inc

View File

@@ -0,0 +1,61 @@
--source include/have_binlog_format_row.inc
--source include/have_debug.inc
--source include/master-slave.inc
--connection master
# Set minimal cache size so smaller transaction can trigger spill to disk.
SET @save_binlog_stmt_cache_size= @@GLOBAL.binlog_stmt_cache_size;
SET GLOBAL binlog_stmt_cache_size= 4096;
CALL mtr.add_suppression('"No space left on device".*An incident event is written to binary log');
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(255)) ENGINE=MyISAM;
FLUSH STATUS;
SHOW STATUS LIKE "binlog_stmt_cache%";
INSERT INTO t1 VALUES (0, CONCAT("?", "-", REPEAT("x", 200)));
INSERT INTO t1 SELECT a+1, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+2, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+4, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+8, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+16, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+32, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+64, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
INSERT INTO t1 SELECT a+128, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
SHOW STATUS LIKE "binlog_stmt_cache%";
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,simulate_disk_full_at_flush_pending";
--replace_regex /Error writing file '[^']+'/Error writing file '<FILENAME>'/
--error 3
INSERT INTO t1 SELECT a+256, CONCAT(a, "-", REPEAT("x", 200)) FROM t1;
SET SESSION debug_dbug= @old_dbug;
SHOW STATUS LIKE "binlog_stmt_cache%";
# The actual number of rows left after the disk full error may change as
# binlog event sizes are modified. So here we just test that we get partial
# update from the last INSERT..SELECT that gets disk full error.
SELECT IF(COUNT(*) > 256 AND COUNT(*) < 512,
"ok",
CONCAT("ERROR! Row count ", COUNT(*), " not as expected for partially executed query"))
AS check_result
FROM t1;
# A random extra event that helped show the bug that a partial event
# group was binlogged.
ALTER TABLE t1 COMMENT '<mumble>';
--save_master_pos
--connection slave
--let $slave_sql_errno= 1590
--source include/wait_for_slave_sql_error_and_skip.inc
--sync_with_master
SELECT COUNT(*) FROM t1;
# Cleanup
--connection master
SET GLOBAL binlog_stmt_cache_size= @save_binlog_stmt_cache_size;
DROP TABLE t1;
--source include/rpl_end.inc

View File

@@ -89,6 +89,9 @@ flush logs;
flush logs;
-- source include/wait_for_binlog_checkpoint.inc
flush logs;
# The binlog position here is output in the error message from
# wait_for_slave_io_error below, so make sure it's deterministic.
-- source include/wait_for_binlog_checkpoint.inc
sync_slave_with_master;
#connection slave;

View File

@@ -16,7 +16,7 @@ CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= '';
START SLAVE;
--let $slave_io_errno= 1045, 1593
--source include/wait_for_slave_io_error.inc
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
START SLAVE;

View File

@@ -149,8 +149,7 @@ connection slave;
SELECT * FROM t1;
SET @@global.debug_dbug=@saved_dbug;
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
@@ -218,7 +217,7 @@ SELECT * FROM t1;
SET @@global.debug_dbug=@saved_dbug;
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
@@ -286,7 +285,7 @@ SELECT * FROM t1;
SET @@global.debug_dbug=@saved_dbug;
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before
@@ -354,7 +353,7 @@ SELECT * FROM t1;
SET @@global.debug_dbug=@saved_dbug;
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
--echo DO_DOMAIN_IDS (BEFORE) : $do_domain_ids_before

View File

@@ -67,8 +67,10 @@ connection master;
save_master_pos;
--connection slave
--source include/stop_slave.inc
--source include/start_slave.inc
--let rpl_allow_error=1
--source include/wait_for_slave_io_to_start.inc
--let rpl_allow_error=
--source include/wait_for_slave_sql_to_start.inc
sync_with_master;
select * from ti;
select * from tm;

View File

@@ -3,7 +3,7 @@ source include/have_binlog_format_mixed.inc;
source include/master-slave.inc;
connection slave;
CALL mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: Debug Induced Error");
set @old_dbug=@@global.debug_dbug;
set global debug_dbug='d,fail_com_register_slave';
@@ -11,8 +11,11 @@ stop slave;
reset slave;
source include/wait_for_slave_to_stop.inc;
start slave;
stop slave;
source include/wait_for_slave_to_stop.inc;
# Debug point will raise IO thread error ER_SLAVE_MASTER_COM_FAILURE
# so we will wait for that and manually stop the SQL thread
--let $slave_io_errno= 1597
--source include/wait_for_slave_io_error.inc
--source include/stop_slave_sql.inc
set global debug_dbug=@old_dbug;
connection master;

View File

@@ -19,7 +19,7 @@ INSERT INTO t1 VALUES (1);
CALL mtr.add_suppression("Slave: Failed to open mysql.gtid_slave_pos");
--let $slave_sql_errno=1944
--source include/wait_for_slave_sql_error.inc
--let $rpl_only_running_threads= 1
--source include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;

View File

@@ -31,8 +31,8 @@ SET sql_log_bin=1;
START SLAVE;
--let $slave_sql_errno=1062
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
--source include/wait_for_slave_io_to_start.inc
--source include/stop_slave_io.inc
# Skip the problem event from the master.
SET GLOBAL gtid_slave_pos= "0-1-100";
--source include/start_slave.inc
@@ -51,7 +51,7 @@ SET debug_dbug= @dbug_save;
--connection slave
--let $slave_sql_errno=1590
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
--source include/stop_slave_io.inc
SET sql_slave_skip_counter=1;
--source include/start_slave.inc
--sync_with_master

View File

@@ -50,7 +50,7 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
START SLAVE;
--let $slave_io_errno= 1236
--source include/wait_for_slave_io_error.inc
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,

View File

@@ -207,7 +207,7 @@ SET sql_log_bin=0;
call mtr.add_suppression("Failed to load slave replication state from table");
call mtr.add_suppression("Unable to load replication GTID slave state");
SET sql_log_bin=1;
--let rpl_allow_error= 1
--source include/start_slave.inc
--connection server_1
INSERT INTO t1 VALUES (9);

View File

@@ -327,7 +327,7 @@ sleep 4;
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
--echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result
--source include/stop_slave.inc
--source include/stop_slave_io.inc
DROP TABLE t1;
--echo

View File

@@ -102,14 +102,17 @@ BEGIN
UPDATE t13 SET c = '';
END|
# Create events which will run every 1 sec
CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO
# Create events which will run every 10 sec
# It cannot be much shorter as we have to ensure that a new
# event is not scheduled before the DISABLE has been
# executed.
CREATE EVENT e1 ON SCHEDULE EVERY 10 SECOND DISABLE DO
BEGIN
ALTER EVENT e1 DISABLE;
CALL p1(10, '');
END|
CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND DISABLE DO
CREATE EVENT e11 ON SCHEDULE EVERY 10 SECOND DISABLE DO
BEGIN
ALTER EVENT e11 DISABLE;
CALL p11(10, '');

View File

@@ -20,6 +20,7 @@ SET @@global.debug_dbug='+d,simulate_slave_capability_none';
connection master;
FLUSH LOGS;
--source include/wait_for_binlog_checkpoint.inc
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (0);
sync_slave_with_master;

View File

@@ -40,8 +40,7 @@ SELECT * FROM t1;
SELECT * FROM t1;
# restart replication for the next testcase
stop slave;
--source include/wait_for_slave_to_stop.inc
--source include/stop_slave_io.inc
reset slave;
connection master;
reset master;
@@ -159,8 +158,7 @@ SELECT * FROM t1;
SELECT * FROM t1;
# restart replication for the next testcase
stop slave;
--source include/wait_for_slave_to_stop.inc
--source include/stop_slave_io.inc
reset slave;
connection master;
reset master;

View File

@@ -93,7 +93,9 @@ COMMIT;
# Clean up.
--connection server_2
--source include/stop_slave.inc
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave_io.inc
--let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32
--let $assert_text= table t1 should have zero rows where a>32
--source include/assert.inc

View File

@@ -60,7 +60,6 @@ SET debug_sync='RESET';
--connection server_2
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error.inc
--source include/wait_for_slave_sql_to_stop.inc
# We should not see the row (112,3) here, it should be rolled back due to
# error signal from the prior transaction.
SELECT * FROM t3 WHERE a >= 110 ORDER BY a;

View File

@@ -469,6 +469,7 @@ if (`SELECT count(*) = 1 FROM t1 WHERE a = 2`)
# Clean up
#
--connection server_2
--let $rpl_only_running_threads= 1
--source include/stop_slave.inc
SET @@GLOBAL.slave_parallel_threads=@old_parallel_threads;
SET @@GLOBAL.slave_parallel_mode=@old_parallel_mode;

View File

@@ -39,7 +39,7 @@ SET @@global.debug_dbug="d,inject_tblmap_same_id_maps_diff_table";
# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
--let $slave_sql_errno=1593
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
--source include/stop_slave_io.inc
# clean up
SET @@global.debug_dbug=@saved_debug;

View File

@@ -139,7 +139,9 @@ select * from ti1 order by b /* must be (2),(3) */;
--echo *** slave must stop (Trying to delete a referenced foreing key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_ROW_IS_REFERENCED_2 # Cannot add or update a child row: a foreign key constraint fails
--let slave_sql_errno= 1451
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -173,7 +175,9 @@ insert into ti2 set a=3, b=3 /* offending write event */;
--echo *** slave must stop (Trying to insert an invalid foreign key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_NO_REFERENCED_ROW_2 # Cannot add or update a parent row: a foreign key constraint fails
--let slave_sql_errno= 1452
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -210,9 +214,11 @@ insert into ti1 set b=1;
connection master;
insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop (Trying to insert a dupliacte key)
--echo *** slave must stop (Trying to insert a duplicate key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_DUP_ENTRY # Duplicate entry for key
--let slave_sql_errno= 1062
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -247,7 +253,10 @@ DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_KEY_NOT_FOUND # Can't find record
--let slave_sql_errno= 1032
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -265,7 +274,9 @@ connection master;
DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_KEY_NOT_FOUND # Can't find record
--let slave_sql_errno= 1032
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -287,7 +298,9 @@ UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_KEY_NOT_FOUND # Can't find record
--let slave_sql_errno= 1032
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;
@@ -307,7 +320,9 @@ UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
# ER_KEY_NOT_FOUND # Can't find record
--let slave_sql_errno= 1032
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log;

View File

@@ -101,7 +101,12 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
--replace_result 740 MASTER_LOG_POS
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;
--source include/stop_slave.inc
# Explicit wait for slave thread start and then stop. Otherwise the STOP SLAVE
# command can abort the slave connecting to the master, and an error state
# left which makes stop_slave.inc throw an error.
--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
--source include/stop_slave_io.inc
RESET SLAVE;
--source include/start_slave.inc

View File

@@ -30,8 +30,12 @@ connection master;
--let $rpl_server_number=1
source include/rpl_stop_server.inc;
# After stoping the master, slave receives the disconnect error (2003)
--connection slave
--source include/stop_slave.inc
--let $slave_io_errno=2003
--let $slave_io_error_is_nonfatal=1
--source include/wait_for_slave_io_error.inc
--let $slave_io_error_is_nonfatal=0
#connection master;
--echo # Restart master
@@ -42,8 +46,10 @@ source include/rpl_start_server.inc;
# Clean up
#
--connection slave
--source include/stop_slave.inc
--source include/start_slave.inc
--source include/wait_for_slave_sql_to_start.inc
--let rpl_allow_error=1
--source include/wait_for_slave_io_to_start.inc
#--source include/start_slave.inc
--connection master
SET @@GLOBAL.debug_dbug="";

View File

@@ -116,11 +116,13 @@ show status like 'Rpl_semi_sync_master_no_tx';
--connection server_2
--eval SET @@GLOBAL.debug_dbug= "$sav_server_2_dbug"
--eval SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0
--let $rpl_only_running_threads= 1
source include/stop_slave.inc;
--connection server_3
--eval SET @@GLOBAL.debug_dbug= "$sav_server_3_dbug"
--eval SET @@GLOBAL.rpl_semi_sync_slave_enabled= 0
--let $rpl_only_running_threads= 1
source include/stop_slave.inc;
--echo #-- Bring the master back up

View File

@@ -40,7 +40,7 @@ DROP TABLE t1;
--let $assert_select=Read semi-sync reply magic number error
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_count= 0
--let $assert_only_after = CURRENT_TEST:rpl.rpl_semi_sync_slave_compressed_protocol.test
--let $assert_only_after = CURRENT_TEST: rpl.rpl_semi_sync_slave_compressed_protocol
--source include/assert_grep.inc
--connection master

View File

@@ -78,7 +78,7 @@ insert into t1 values (10);
--connection master
set statement sql_log_bin=0 for call mtr.add_suppression("Read semi-sync reply magic number error");
SET @save_debug_master= @@global.debug;
SET @save_debug_master= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,semisync_corrupt_magic";
insert into t1 values (11);

View File

@@ -26,6 +26,7 @@ eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT,
SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
stop slave;
--source include/wait_for_slave_to_stop.inc
reset slave all;

View File

@@ -15,6 +15,7 @@ call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory")
--let $slave_sql_errno= 12
source include/wait_for_slave_sql_error.inc;
--source include/wait_for_slave_io_to_start.inc
--source include/stop_slave_io.inc
RESET SLAVE;

View File

@@ -59,7 +59,6 @@ sync_slave_with_master;
source include/stop_slave.inc;
START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
source include/wait_for_slave_io_to_stop.inc;
--echo ==== Verify that Slave IO thread stopped with error ====
# 1045 = ER_ACCESS_DENIED_ERROR
@@ -68,7 +67,7 @@ source include/wait_for_slave_io_to_stop.inc;
--echo ==== Cleanup (Note that slave IO thread is not running) ====
# cleanup: slave io thread has is stopped so we reset replication
# cleanup: slave io thread is stopped so we reset replication
--source include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
# clear Slave_IO_Errno

View File

@@ -76,6 +76,10 @@ if ($last_error)
set debug_sync= "now signal sql_thread_continue";
--echo # Wait for debug_sync signal to have been received before issuing RESET
let $wait_condition= select count(*)=0 from information_schema.processlist where state like "debug sync point%";
source include/wait_condition.inc;
set @@global.debug_dbug= @saved_dbug;
set debug_sync= "RESET";

View File

@@ -29,8 +29,10 @@ connection slave;
select * from t1;
#showing that replication could work with ssl params
stop slave;
--source include/wait_for_slave_to_stop.inc
--let $slave_io_errno=1045
--source include/wait_for_slave_io_error.inc
--source include/stop_slave_sql.inc
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval change master to master_ssl=1 , master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;

View File

@@ -71,13 +71,15 @@ connection slave;
set @@global.innodb_lock_wait_timeout=1;
set @@global.slave_transaction_retries=100;
--let $rpl_allow_error=1
--source include/restart_slave_sql.inc
--let $rpl_allow_error=0
--let $last_retries= query_get_value(SHOW GLOBAL STATUS LIKE 'Slave_retried_transactions', Value, 1)
--let $status_type=GLOBAL
--let $status_var=Slave_retried_transactions
--let $status_var_value=`SELECT 1 + $last_retries`
--let $$status_var_comparsion= >
--let $status_var_comparsion= >
--source include/wait_for_status_var.inc
# Release the record after just one retry

View File

@@ -19,7 +19,7 @@ insert into t1 values (1);
reset master;
--connection slave
--source include/stop_slave.inc
--source include/stop_slave_sql.inc
reset slave;
--source include/start_slave.inc

View File

@@ -15,6 +15,9 @@ call mtr.add_suppression("Master is configured to log replication events");
# All done.
--connection slave
# The parallel START SLAVE can leave an error condition if the last START was
# aborted by the master due to conflicting server_id from multiple connections.
--let $rpl_allow_error= 1
--source include/wait_for_slave_to_stop.inc
start slave;