Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit55416b2

Browse files
committed
Guard against core dump from uninitialized subplan.
If the planner erroneously puts a non-parallel-safe SubPlan intoa parallelized portion of the query tree, nodeSubplan.c will failin 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 tomake that an error case rather than a core dump case.This probably should have been included in commit16ebab6, whichwas responsible for allowing nulls to appear in es_subplanstatesto begin with. So, back-patch to v10 where that came in.Discussion:https://postgr.es/m/924226.1604422326@sss.pgh.pa.us
1 parent136f87e commit55416b2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/backend/executor/nodeSubplan.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,15 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
798798
sstate->planstate= (PlanState*)list_nth(estate->es_subplanstates,
799799
subplan->plan_id-1);
800800

801-
/* ... and to its parent's state */
801+
/*
802+
* This check can fail if the planner mistakenly puts a parallel-unsafe
803+
* subplan into a parallelized subquery; see ExecSerializePlan.
804+
*/
805+
if (sstate->planstate==NULL)
806+
elog(ERROR,"subplan \"%s\" was not initialized",
807+
subplan->plan_name);
808+
809+
/* Link to parent's state, too */
802810
sstate->parent=parent;
803811

804812
/* Initialize subexpressions */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp