Debian Codegraph @

mysql-test/suite/rpl/t/rpl_skip_incident_error.test

raw
1 # ==== Purpose ====
2 #
3 # Verify that we can skip an incident event by setting --replica-skip-errors=1590
4 # on slave.
5 #
6 # ==== Implementation ====
7 #
8 # 1. a single statement on non-transactional table causes to log an incident
9 # event with an unique gtid due to the fact that the stmt_cache is not
10 # big enough to accommodate the changes.
11 #
12 # 2. sync slave sql with master to verify that we can skip the incident event
13 # by setting --replica-skip-errors=1590 on slave.
14 #
15 # ==== References ====
16 #
17 # Bug #26266758 SKIPPING MYSQL SLAVE ERROR CODE 1590 (ER_REPLICA_INCIDENT) DOES NOT WORK
18 # See mysql-test/suite/rpl/t/rpl_skip_incident_error_cross.test
19
20 --source include/not_group_replication_plugin.inc
21 # Test in this file is binlog format agnostic, thus no need
22 # to rerun it for every format.
23 --source include/have_binlog_format_row.inc
24 --source include/force_myisam_default.inc
25 --source include/have_myisam.inc
26 --source include/master-slave.inc
27
28 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
29 call mtr.add_suppression("Replica SQL for channel '': The incident LOST_EVENTS occurred on the source.");
30 call mtr.add_suppression("Non-transactional changes were not written to the binlog. An incident event has been written to the binary log which will stop the replicas.");
31
32 --let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1)
33 --let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1)
34 SET GLOBAL max_binlog_stmt_cache_size = 4096;
35 SET GLOBAL binlog_stmt_cache_size = 4096;
36
37 --disconnect master
38 --connect(master,127.0.0.1,root,,test,$MASTER_MYPORT,)
39 --let $data= `SELECT CONCAT('"', repeat('a',2000), '"')`
40
41 CREATE TABLE t1(c1 INT PRIMARY KEY, data TEXT(30000)) ENGINE=MyIsam;
42
43 --let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1)
44 --echo #
45 --echo # A single statement on non-transactional table causes to log an incident
46 --echo # event with an unique gtid due to the fact that the stmt_cache is not
47 --echo # big enough to accommodate the changes.
48 --echo #
49 --disable_query_log
50 --error ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
51 eval INSERT INTO t1 (c1, data) VALUES (1,
52 CONCAT($data, $data, $data, $data, $data, $data));
53 --enable_query_log
54
55 --let $binlog_start= $saved_master_pos
56 --source include/show_binlog_events.inc
57
58 INSERT INTO t1 (c1, data) VALUES (2, 'b');
59
60 --echo #
61 --echo # Verify that we can skip the incident event by setting
62 --echo # --replica-skip-errors=1590 on slave.
63 --echo #
64 --source include/sync_slave_sql_with_master.inc
65
66 # Cleanup
67 --source include/rpl_connection_master.inc
68 DROP TABLE t1;
69 --replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
70 --eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
71 --replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
72 --eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
73
74 --source include/rpl_end.inc