Debian Codegraph @

mysql-test/suite/binlog_gtid/t/binlog_flush_logs_error.test

raw
1 ###############################################################################
2 # Bug #26272158: FLUSH LOGS SENDS OK EVEN AFTER FAILING IN THE COMMIT PHASE.
3 #
4 # Problem:
5 # ========
6 # A failing FLUSH LOGS attempts to send OK to connection after
7 # having sent error reply before. This is caused by missing error propagation
8 # between where the error happened (ha_commit_trans inside close_table()) and
9 # where the OK is sent (at the top level switch statement in
10 # mysql_execute_command)
11 #
12 # Test:
13 # =====
14 # We will activate the debug point "simulate_flush_commit_error" this will ensure
15 # that the commit fails for FLUSH LOGS. We will then check if the command
16 # FLUSH LOGS returns an error.
17 ###############################################################################
18
19 # Don't test this under valgrind, memory leaks will occur
20 --source include/not_valgrind.inc
21 --source include/have_debug.inc
22 # Test in this file is binlog format agnostic, thus no need
23 # to rerun it for every format.
24 --source include/have_binlog_format_row.inc
25 call mtr.add_suppression('Could not open .*');
26 call mtr.add_suppression("Either disk is full or file system is read only");
27 call mtr.add_suppression("An out-of-memory error occurred while saving the set of GTID.*");
28 call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
29 call mtr.add_suppression("Got error .*");
30 CALL mtr.add_suppression("Unable to create a new binlog file.");
31
32 # Set the debug option that will simulate crash commit
33 FLUSH LOGS;
34 SET GLOBAL debug = '+d,simulate_flush_commit_error';
35
36 CREATE TABLE t(s INT);
37 INSERT INTO t VALUES(10);
38
39 --error ER_ERROR_DURING_FLUSH_LOGS, ER_BINLOG_LOGGING_IMPOSSIBLE
40 FLUSH LOGS;
41 SET GLOBAL debug = '-d,simulate_flush_commit_error';
42
43 #cleanup
44 DROP TABLE t;
45