Debian Codegraph @

mysql-test/suite/binlog/t/binlog_purge_binary_logs_stall.test

raw
1 # ==== Purpose ====
2 #
3 # This test will purge old binary log files in the server and
4 # will verify how many events the server will read from the
5 # remaining binary log file.
6 #
7 # ==== Related Bugs and Worklogs ====
8 #
9 # BUG#23054591 PURGE BINARY LOGS TO IS READING THE WHOLE BINLOG FILE AND
10 # CAUSING MYSQL TO STALL
11 #
12
13 # This test case is binary log format agnostic
14 --source include/have_debug.inc
15 --source include/have_binlog_format_row.inc
16
17 # Create a new binary log file
18 FLUSH BINARY LOGS;
19
20 # Add some events to the new binary log file
21 CREATE TABLE t1 (c1 INT);
22 INSERT INTO t1 VALUES (1);
23 DROP TABLE t1;
24
25 # Get the current binlog file name
26 --let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
27
28 # Purge older binary log files
29 --replace_result '$binlog_file' BINLOG_FILE
30 --eval PURGE BINARY LOGS TO '$binlog_file'
31
32 # File to GREP
33 --let $assert_file=$MYSQLTEST_VARDIR/tmp/binlog_purge_stall.err
34 # Show entries only after the last occurrence of the following pattern
35 --let $assert_only_after=.* \[Note\] \[[^]]*\] \[[^]]*\] .* mysqld: ready for connections
36 # Assert that there is an expected [Note] log line about reading binary log events
37 --let $assert_count= 1
38 --let $assert_select=.* \[Note\] \[[^]]*\] \[[^]]*\] Read 2 events from binary log file .*$binlog_file
39 --let $assert_text= Only two events were read from the binary log file (binlog_gtid_simple_recovery=TRUE).
40 --source include/assert_grep.inc