Add some recursion and looping defenses in prepjointree.c. Andrey Lepikhov demonstrated a case where we spend an unreasonable amount of time in pull_up_subqueries(). Not only is that recursing with no explicit check for stack overrun, but the code seems not interruptable by control-C. Let's stick a CHECK_FOR_INTERRUPTS there, along with sprinkling some stack depth checks.
An actual fix for the excessive time consumption seems a bit risky to back-patch; but this isn't, so let's do so. Discussion: https://postgr.es/m/[email protected] Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4fceb454f2df57f63d05ccb4a26a9f49c377f28c Modified Files -------------- src/backend/optimizer/prep/prepjointree.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
