• Igor Babaev's avatar
    Fixed mdev-14852 Fails to reopen temp table within standard CTE · 0de565a5
    Igor Babaev authored
    If the specification of a CTE contains a reference to a temporary table
    then THD::open_temporary_table() must be called for this reference for
    any occurrence of the CTE in the query. By mistake this was done only
    for the first occurrences of CTEs.
    The patch fixes this problem in With_element::clone_parsed_spec().
    It also moves there the call of check_dependencies_in_with_clauses()
    to its proper place before the call of check_table_access().
    Additionally the patch optimizes the number of calls of the
    function check_dependencies_in_with_clauses().
    0de565a5
sql_parse.cc 312 KB