From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add some recursion and looping defenses in prepjointree.c.
Date: Thu, 22 Dec 2022 15:35:24 +0000
Message-ID: <E1p8NbP-004t6o-5R@gemulon.postgresql.org> (raw)
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/703c09a2-08f3-d2ec-b33d-dbecd62428b8@postgrespro.ru
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/8cd700cc5a676282912c7080cfa142977a2dd851
Modified Files
--------------
src/backend/optimizer/prep/prepjointree.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Add some recursion and looping defenses in prepjointree.c.
In-Reply-To: <E1p8NbP-004t6o-5R@gemulon.postgresql.org>
References: <E1p8NbP-004t6o-5R@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox