Skip to content
  • Joao Gramacho's avatar
    1f1b47e6
    Bug#23490641 ASSERTION FAILURE IN 'MYSQL_BIN_LOG::PREPARE()' IF DML IS · 1f1b47e6
    Joao Gramacho authored
                 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.
    1f1b47e6
    Bug#23490641 ASSERTION FAILURE IN 'MYSQL_BIN_LOG::PREPARE()' IF DML IS
    Joao Gramacho authored
                 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