• Ajo Robert's avatar
    Bug#20691429 ASSERTION `CHILD_L' FAILED IN STORAGE/MYISAMMRG/ · 6d1e2fbc
    Ajo Robert authored
    HA_MYISAMMRG.CC:631
    
    Analysis
    ========
    Any attempt to open a temporary MyISAM merge table consisting
    of a view in its list of tables (not the last table in the list)
    under LOCK TABLES causes the server to exit.
    
    Current implementation doesn't perform sanity checks during
    merge table creation. This allows merge table to be created
    with incompatible tables (table with non-myisam engine),
    views or even with table doesn't exist in the system.
    
    During view open, check to verify whether requested view
    is part of a merge table is missing under LOCK TABLES path
    in open_table(). This leads to opening of underlying table
    with parent_l having NULL value. Later when attaching child
    tables to parent, this hits an ASSERT as all child tables
    should have parent_l pointing to merge parent. If the operation
    does not happen under LOCK TABLES mode, open_table() checks
    for view's parent_l and returns error.
    
    Fix:
    ======
    Check added before opening view Under LOCK TABLES in open_table()
    to verify whether it is part of merge table. Error is returned
    if the view is part of a merge table.
    6d1e2fbc
sql_base.cc 306 KB