############################################################################### # Bug #26272158: FLUSH LOGS SENDS OK EVEN AFTER FAILING IN THE COMMIT PHASE. # # Problem: # ======== # A failing FLUSH LOGS attempts to send OK to connection after # having sent error reply before. This is caused by missing error propagation # between where the error happened (ha_commit_trans inside close_table()) and # where the OK is sent (at the top level switch statement in # mysql_execute_command) # # Test: # ===== # We will activate the debug point "simulate_flush_commit_error" this will ensure # that the commit fails for FLUSH LOGS. We will then check if the command # FLUSH LOGS returns an error. ############################################################################### # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc --source include/have_debug.inc # Test in this file is binlog format agnostic, thus no need # to rerun it for every format. --source include/have_binlog_format_row.inc call mtr.add_suppression('Could not open .*'); call mtr.add_suppression("Either disk is full or file system is read only"); call mtr.add_suppression("An out-of-memory error occurred while saving the set of GTID.*"); call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); call mtr.add_suppression("Got error .*"); CALL mtr.add_suppression("Unable to create a new binlog file."); # Set the debug option that will simulate crash commit FLUSH LOGS; SET GLOBAL debug = '+d,simulate_flush_commit_error'; CREATE TABLE t(s INT); INSERT INTO t VALUES(10); --error ER_ERROR_DURING_FLUSH_LOGS, ER_BINLOG_LOGGING_IMPOSSIBLE FLUSH LOGS; SET GLOBAL debug = '-d,simulate_flush_commit_error'; #cleanup DROP TABLE t;