• Igor Babaev's avatar
    MDEV-22786 Crashes with nested table value constructors · 08d8bce5
    Igor Babaev authored
    The bug caused crashes of the server when processing queries with nested
    table value constructors (TVC) . It happened because the grammar rules to
    parse TVC used the same global lists for both nested TVC and nesting TVC.
    As a result invalid select trees were constructed for queries with nested
    TVC and this led to crashes at the prepare stage.
    This patch provides its own lists structures for each TVC nest level.
    
    Besides the patch fixes a bug in the function wrap_tvc() that missed
    inheritance of the SELECT_LEX::exclude_from_table_unique_test for
    selects that wrapped TVCs. This inheritance is critical for specifications
    of derived tables that employ nested TVCs.
    
    Approved by dmitry.shulga@mariadb.com
    08d8bce5
sql_yacc.yy 555 KB