• Igor Babaev's avatar
    Fixed LP bug #824463. · be03fe9c
    Igor Babaev authored
    When merging a view / derived table the function SELECT_LEX::merge_subquery
    incorrectly updated the list SELECT_LEX::leaf_tables. Erroneously it
    appended the leaf_tables list of the merged object L and then removed the
    reference to the merged object T from the SELECT_LEX::leaf_tables list.
    A correct implementation should insert the list L into the
    SELECT_LEX::leaf_tables list in place of the element of the list that 
    refers to T.
    The bug could lead to wrong results or even crashes for queries with
    nested outer joins over views / derived tables.
    be03fe9c
derived_view.result 54 KB