• Jon Olav Hauglid's avatar
    Bug #57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW · 0fb0d9a9
    Jon Olav Hauglid authored
    This crash could happen if SHOW CREATE VIEW indirectly failed to open a
    view due to failures to open underlying tables (or functions). Several
    such errors were hidden and converted to ER_VIEW_INVALID warnings to
    prevent exposing details of underlying tables for which the user have
    no privileges.
    
    However, with the changes introduced by the patch for Bug#52044,
    failing to open a view will cause opened tables, views and functions
    to be closed. Since the errors causing these failures were converted
    to warnings, SHOW CREATE VIEW would try to continue. This made it
    possible to try to access memory that had been freed, causing a crash.
    
    This patch fixes the problem by not closing opened tables, views and
    functions in these cases. This allows SHOW CREATE VIEW to continue
    and also prevents it from accessing freed memory.
    
    Test case added to lock_sync.test.
    0fb0d9a9
lock_sync.test 35.5 KB