• ramil/ram@mysql.com/myoffice.izhnet.ru's avatar
    Fix for bug #21587: FLUSH TABLES causes server crash when used with HANDLER statements · 55aa6e04
    Problems (appear only under some circumstances): 
      1. we get a reference to a deleted table searching in the 
         thd->handler_tables_hash in the mysql_ha_read().
    
      2. DBUG_ASSERT(table->file->inited == handler::NONE); assert fails in the
         close_thread_table().
    
    Fix: end open index scans and table scans and remove references to the 
    tables from the handler tables hash. After this preparation it is safe 
    to close the tables. The close can no longer fail on open index/table 
    scans and the closed table will not be used again by handler functions.
                                     
    55aa6e04
sql_base.cc 167 KB