• Igor Babaev's avatar
    MDEV-26108 Crash with query referencing twice CTE that uses embedded recursive CTE · 78735dca
    Igor Babaev authored
    This bug could affect queries that had at least two references to a CTE that
    used an embedded recursive CTE.
    Starting from version 10.4 some code in With_element::clone_parsed_spec()
    that assumed a certain order of selects after parsing the specification of
    a CTE became not valid anymore. It could lead to global select lists where
    some selects were missing. If a missing CTE happened to belong to the
    recursive part of a recursive CTE some recursive table references were not
    set as references to materialized derived tables and this caused a crash of
    the server.
    
    Approved by Oleksandr Byelkin <sanja@mariadb.com>
    78735dca
sql_cte.cc 52.6 KB