• unknown's avatar
    BUG#20919 temp tables closing fails when binlog is off · 868fee4d
    unknown authored
    closing temp tables through end_thread
    had a flaw in binlog-off branch of close_temporary_tables where
    next table to close was reset via table->next
     for (table= thd->temporary_tables; table; table= table->next)
    which was wrong since the current table instance got destoyed at
    	close_temporary(table, 1);
    
    The fix adapts binlog-on branch method to engage the loop's internal 'next' variable which holds table->next prior table's destoying.
    
    
    
    sql/sql_base.cc:
      no-binlog branch is fixed: scanning across temporary_tables must be careful to save next table since the current is being destroyed inside of close_temporary. 
      binlog-is-open case is ok.
    868fee4d
sql_base.cc 86.3 KB