• Luis Soares's avatar
    BUG#51226: mysqlbinlog replay: ERROR 1146 when using temp tables · 24f7afe7
    Luis Soares authored
               + failing statements
    
    Implicit DROP event for temporary table is not getting
    LOG_EVENT_THREAD_SPECIFIC_F flag, because, in the previous
    executed statement in the same thread, which might even be a
    failed statement, the thread_specific_used flag is set to
    FALSE (in mysql_reset_thd_for_next_command) and not set to TRUE
    before connection is shutdown. This means that implicit DROP
    event will take the FALSE value from thread_specific_used and
    will not set LOG_EVENT_THREAD_SPECIFIC_F in the event header. As
    a consequence, mysqlbinlog will not print the pseudo_thread_id
    from the DROP event, because one of the requirements for the
    printout is that this flag is set to TRUE.
    
    We fix this by setting thread_specific_used whenever we are
    binlogging a DROP in close_temporary_tables, and resetting it to
    its previous value afterward.
    24f7afe7
binlog_tmp_table.test 3.94 KB