• Dmitry Lenev's avatar
    Fix for bug #11754210 - "45777: CHECK TABLE DOESN'T · 9fe60b4d
    Dmitry Lenev authored
    SHOW ALL PROBLEMS FOR MERGE TABLE COMPLIANCE IN 5.1".
    
    The problem was that CHECK/REPAIR TABLE for a MERGE table which
    had several children missing or in wrong engine reported only
    issue with the first such table in its result-set. While in 5.0
    this statement returned the whole list of problematic tables.
    
    Ability to report problems for all children was lost during
    significant refactorings of MERGE code which were done as part
    of work on 5.1 and 5.5 releases.
    
    This patch restores status quo ante refactorings by changing
    code in such a way that:
    1) Failure to open child table due to its absence during CHECK/
       REPAIR TABLE for a MERGE table is not reported immediately
       when its absence is discovered in open_tables(). Instead
       handling/error reporting in such a situation is postponed
       until the moment when children are attached.
    2) Code performing attaching of children no longer stops when
       it encounters first problem with one of the children during
       CHECK/REPAIR TABLE. Instead it continues iteration through
       the child list until all problems caused by child absence/
       wrong engine are reported.
    
    Note that even after this change problem with mismatch of
    child/parent definition won't be reported if there is also
    another child missing, but this is how it was in 5.0 as well.
    9fe60b4d
merge.test 81.2 KB