Skip to content

Commit e0022f5

Browse files
Alexander PyhalovCommitfest Bot
Alexander Pyhalov
authored and
Commitfest Bot
committed
mark_async_capable(): subpath should match subplan
1 parent 128897b commit e0022f5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/optimizer/plan/createplan.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,10 +1149,10 @@ mark_async_capable_plan(Plan *plan, Path *path)
11491149
SubqueryScan *scan_plan = (SubqueryScan *) plan;
11501150

11511151
/*
1152-
* If the generated plan node includes a gating Result node,
1153-
* we can't execute it asynchronously.
1152+
* If the generated plan node includes a gating Result node or
1153+
* a Sort node, we can't execute it asynchronously.
11541154
*/
1155-
if (IsA(plan, Result))
1155+
if (IsA(plan, Result) || IsA(plan, Sort))
11561156
return false;
11571157

11581158
/*
@@ -1170,10 +1170,10 @@ mark_async_capable_plan(Plan *plan, Path *path)
11701170
FdwRoutine *fdwroutine = path->parent->fdwroutine;
11711171

11721172
/*
1173-
* If the generated plan node includes a gating Result node,
1174-
* we can't execute it asynchronously.
1173+
* If the generated plan node includes a gating Result node or
1174+
* a Sort node, we can't execute it asynchronously.
11751175
*/
1176-
if (IsA(plan, Result))
1176+
if (IsA(plan, Result) || IsA(plan, Sort))
11771177
return false;
11781178

11791179
Assert(fdwroutine != NULL);
@@ -1186,9 +1186,9 @@ mark_async_capable_plan(Plan *plan, Path *path)
11861186

11871187
/*
11881188
* If the generated plan node includes a Result node for the
1189-
* projection, we can't execute it asynchronously.
1189+
* projection or a Sort node, we can't execute it asynchronously.
11901190
*/
1191-
if (IsA(plan, Result))
1191+
if (IsA(plan, Result) || IsA(plan, Sort))
11921192
return false;
11931193

11941194
/*

0 commit comments

Comments
 (0)