• Igor Babaev's avatar
    MDEV-24597 Explicit column name error in CTE of UNION · 374ec82f
    Igor Babaev authored
    This bug manifested itself when executing queries with multiple reference
    to a CTE specified by a query expression with union and having its
    column names explicitly declared. In this case the server returned a bogus
    error message about unknown column name. It happened because while for the
    first reference to the CTE the names of the columns returned by the CTE
    specification were properly changed to match the CTE definition for the
    other references it was not done. This was a consequence  of not quite
    complete code of the function With_element::clone_parsed_spec() that forgot
    to set the reference to the CTE definition for unit structures representing
    non-first CTE references.
    
    Approved by dmitry.shulga@mariadb.com
    374ec82f
cte_nonrecursive.result 52.8 KB