Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug#23490641 ASSERTION FAILURE IN 'MYSQL_BIN_LOG::PREPARE()' IF DML IS
PASSED IN --INIT-FILE Problem: In order to avoid polluting the binary log (and generating GTIDs) for MySQL initialization statements, the initialize process was refactored to disable binary logging before processing the compiled statements, and enabling the binary logging again once finishing processing the compiled statements and before processing any file passed as parameter to the initialize process. The change above failed when the script/fill_help_tables.sql is updated with current help script that included a "SET sql_log_bin=0;" on it. Analysis: The MYSQL_BIN_LOG::prepare function has an assertion to ensure that the session sql_log_bin variable is true when a statement are prepared to go to the binary log. The bootstrap function that handle the initialize process started with sql_log_bin = true, but disabled the internal representation of it by resetting the OPTION_BIN_LOG bit from thd->variables.option_bits. The fill_help_tables.sql script is disabling the sql_log_bin session variable and it is compiled into the server code. When the initialize process starts to apply a file passed as parameter, it has the internal representation of the binary logging restored (OPTION_BIN_LOG bit of thd->variables.option_bits) but the sql_log_bin session variable was disabled, making the MYSQL_BIN_LOG::prepare assertion to fail. Fix: The initialize process now will check if binary log is enabled while processing compiled statement. It will disable binary logging on such cases.
- Loading branch information