pgsql: Guard against core dump from uninitialized subplan.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Guard against core dump from uninitialized subplan.
Date: 2020-11-03 21:16:51
Message-ID: E1ka3ff-00066S-5R@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Guard against core dump from uninitialized subplan.

If the planner erroneously puts a non-parallel-safe SubPlan into
a parallelized portion of the query tree, nodeSubplan.c will fail
in the worker processes because it finds a null in es_subplanstates,
which it's unable to cope with. It seems worth a test-and-elog to
make that an error case rather than a core dump case.

This probably should have been included in commit 16ebab688, which
was responsible for allowing nulls to appear in es_subplanstates
to begin with. So, back-patch to v10 where that came in.

Discussion: https://postgr.es/m/924226.1604422326@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/92f87182f2c617fd420832972b6d0ae4527301c8

Modified Files
--------------
src/backend/executor/nodeSubplan.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2020-11-03 21:32:49 pgsql: Use INT64_FORMAT to print int64 variables in sort debug
Previous Message Tom Lane 2020-11-03 20:49:11 pgsql: Improve error messages around REPLICATION and BYPASSRLS properti