Debian Codegraph @

mysql-test/suite/heap/restart_binlog_warning.test

raw
1 # MDEV-38600: Test the replication divergence warning that
2 # restarting a slave server binlogs TRUNCATEs for MEMORY tables
3 # (`rpl.rpl_memory_engine_truncate_on_restart` tests the actual TRUNCATE event.
4 # By not adding an MTR suppression,
5 # it also covers the case that a non-slave should not warn about this.)
6
7 --source include/have_binlog_format_mixed.inc # format-agnostic
8
9 CREATE TABLE t ENGINE=memory AS SELECT 1;
10
11
12 # Add a pseudo-master to make this a pseudo-slave
13 CHANGE MASTER TO master_host='127.0.0.1';
14
15 --let $restart_parameters= --read-only=TRUE --skip-slave-start
16 --source include/restart_mysqld.inc # not_embedded
17 SELECT * FROM t; # Maily to trigger MEMORY table discovery
18
19 --let SEARCH_FILE= `SELECT @@log_error`
20 --let SEARCH_PATTERN=\[Warning\] .+?memory table.+?TRUNCATE
21 --source include/search_pattern_in_file.inc
22
23
24 RESET SLAVE ALL;
25 # Repeat the test with an already blank MEMORY table and a named connection
26 CHANGE MASTER 'pseudo-upstream' TO master_host='127.0.0.1';
27
28 --source include/restart_mysqld.inc
29 SELECT * FROM t;
30 --source include/search_pattern_in_file.inc
31
32
33 # Cleanup
34 SET @@GLOBAL.read_only= FALSE;
35 RESET SLAVE 'pseudo-upstream' ALL;
36 DROP TABLE t;
37
38 --eval CALL mtr.add_suppression("$SEARCH_PATTERN")