Skip to content
  • Dmitry Shulga's avatar
    f2fc340b
    This patch fixes the bug#21041908 - EVENTS+RPL: VOID... · f2fc340b
    Dmitry Shulga authored
    This patch fixes the bug#21041908 - EVENTS+RPL: VOID CLOSE_THREAD_TABLES(THD*): ASSERTION THD->GET_TRANSACTION()
    
    The issue is related to the automatic dropping of the event (since the end of
    event's lifetime) and the use of row based binlogging.
    
    After a row for event being dropped has been deleted from the table
    mysql.event the function binlog_log_row is called to record a new entry
    into the binlog. In case row based binlogging is on the following
    sequence of calls are happen to start a new statement-level transaction:
    binlog_log_row --> write_locked_table_maps -->
      THD::binlog_write_table_map --> binlog_start_trans_and_stmt
    
    Latter when open tables are closed the following assert
      DBUG_ASSERT(thd->get_transaction()->is_empty(Transaction_ctx::STMT) ||
                  thd->in_sub_stmt ||
                  (thd->state_flags & Open_tables_state::BACKUPS_AVAIL));
      is fired since there is a statement-level transaction.
    
    To fix the bug simple refactoring has been done to move turning off
    row binlogging inside Event_db_repository::drop_event() that is
    called both when DROP EVENT and automatic dropping are executed.
    f2fc340b
    This patch fixes the bug#21041908 - EVENTS+RPL: VOID...
    Dmitry Shulga authored
    This patch fixes the bug#21041908 - EVENTS+RPL: VOID CLOSE_THREAD_TABLES(THD*): ASSERTION THD->GET_TRANSACTION()
    
    The issue is related to the automatic dropping of the event (since the end of
    event's lifetime) and the use of row based binlogging.
    
    After a row for event being dropped has been deleted from the table
    mysql.event the function binlog_log_row is called to record a new entry
    into the binlog. In case row based binlogging is on the following
    sequence of calls are happen to start a new statement-level transaction:
    binlog_log_row --> write_locked_table_maps -->
      THD::binlog_write_table_map --> binlog_start_trans_and_stmt
    
    Latter when open tables are closed the following assert
      DBUG_ASSERT(thd->get_transaction()->is_empty(Transaction_ctx::STMT) ||
                  thd->in_sub_stmt ||
                  (thd->state_flags & Open_tables_state::BACKUPS_AVAIL));
      is fired since there is a statement-level transaction.
    
    To fix the bug simple refactoring has been done to move turning off
    row binlogging inside Event_db_repository::drop_event() that is
    called both when DROP EVENT and automatic dropping are executed.
Loading