• Kristofer Pettersson's avatar
    Bug#45781 infinite hang/crash in "opening tables" after handler tries to open merge · c9df2a13
    Kristofer Pettersson authored
              table
    
    The MERGE table storage engine does not support the HA_CAN_SQL_HANDLE feature
    and any attempt to open the merge table will fail with ER_ILLEGAL_HA.
    
    After an error occurred the tables that was opened must be closed again
    or they will be left in an inconsistent state. However, the assumption
    made in the code for closing and register handler tables was that only
    one table will be opened, and this is not true for MERGE tables which
    will cause multiple tables to open.
    
    The next time a SELECT operation was issued on the merge table it
    caused the system to freeze.
    
    This patch fixes this issue by making sure that all tables which
    are opened also are closed in the event of an error.
    c9df2a13
merge.test 48.2 KB