• ingo@mysql.com's avatar
    Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash · 1b99d30c
    ingo@mysql.com authored
    Version for 4.0.
    It fixes two problems:
    1. The cause of the bug was that we did not check the table version for
       the HANDLER ... READ commands. We did not notice when a table was
       replaced by a new one. This can happen during ALTER TABLE, REPAIR
       TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
       for this problem "the primary bug fix".
    2. mysql_ha_flush() was not always called with a locked LOCK_open.
       Though the function comment clearly said it must.
       I changed the code so that the locking is done when required. I call
       the fix for this problem "the secondary fix".
    1b99d30c
sql_base.cc 67.3 KB