• Igor Babaev's avatar
    MDEV-17024 Crash on large query · 4d991abd
    Igor Babaev authored
    This problem manifested itself when a join query used two or more
    materialized CTE such that each of them employed the same recursive CTE.
    The bug caused a crash. The crash happened because the cleanup()
    function was performed premature for recursive CTE. This clean up was
    induced by the cleanup of the first CTE referenced the recusrsive CTE.
    This cleanup destroyed the structures that would allow to read from the
    temporary table containing the rows of the recursive CTE and an attempt to read
    these rows for the second CTE referencing the recursive CTE triggered a
    crash.
    The clean up for a recursive CTE R should be performed after the cleanup
    of the last materialized CTE that uses R.
    4d991abd
cte_recursive.result 84.7 KB