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

Commit9c64ddd

Browse files
committed
Fix Parallel Append crash.
Reported by Tom Lane and the buildfarm.Amul Sul and Amit KhandekarDiscussion:http://postgr.es/m/17868.1512519318@sss.pgh.pa.usDiscussion:http://postgr.es/m/CAJ3gD9cJQ4d-XhmZ6BqM9rMM2KDBfpkdgOAb4+psz56uBuMQ_A@mail.gmail.com
1 parent979a36c commit9c64ddd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/backend/executor/nodeAppend.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,16 @@ choose_next_subplan_for_worker(AppendState *node)
506506
node->as_whichplan=pstate->pa_next_plan++;
507507
if (pstate->pa_next_plan >=node->as_nplans)
508508
{
509-
Assert(append->first_partial_plan<node->as_nplans);
510-
pstate->pa_next_plan=append->first_partial_plan;
509+
if (append->first_partial_plan<node->as_nplans)
510+
pstate->pa_next_plan=append->first_partial_plan;
511+
else
512+
{
513+
/*
514+
* We have only non-partial plans, and we already chose the last
515+
* one; so arrange for the other workers to immediately bail out.
516+
*/
517+
pstate->pa_next_plan=INVALID_SUBPLAN_INDEX;
518+
}
511519
}
512520

513521
/* If non-partial, immediately mark as finished. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp