Skip to content

Commit 28390cd

Browse files
Alexander PyhalovCommitfest Bot
authored andcommitted
mark_async_capable(): subpath should match subplan
1 parent 8a27d41 commit 28390cd

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
@@ -1139,10 +1139,10 @@ mark_async_capable_plan(Plan *plan, Path *path)
11391139
SubqueryScan *scan_plan = (SubqueryScan *) plan;
11401140

11411141
/*
1142-
* If the generated plan node includes a gating Result node,
1143-
* we can't execute it asynchronously.
1142+
* If the generated plan node includes a gating Result node or
1143+
* a Sort node, we can't execute it asynchronously.
11441144
*/
1145-
if (IsA(plan, Result))
1145+
if (IsA(plan, Result) || IsA(plan, Sort))
11461146
return false;
11471147

11481148
/*
@@ -1160,10 +1160,10 @@ mark_async_capable_plan(Plan *plan, Path *path)
11601160
FdwRoutine *fdwroutine = path->parent->fdwroutine;
11611161

11621162
/*
1163-
* If the generated plan node includes a gating Result node,
1164-
* we can't execute it asynchronously.
1163+
* If the generated plan node includes a gating Result node or
1164+
* a Sort node, we can't execute it asynchronously.
11651165
*/
1166-
if (IsA(plan, Result))
1166+
if (IsA(plan, Result) || IsA(plan, Sort))
11671167
return false;
11681168

11691169
Assert(fdwroutine != NULL);
@@ -1176,9 +1176,9 @@ mark_async_capable_plan(Plan *plan, Path *path)
11761176

11771177
/*
11781178
* If the generated plan node includes a Result node for the
1179-
* projection, we can't execute it asynchronously.
1179+
* projection or a Sort node, we can't execute it asynchronously.
11801180
*/
1181-
if (IsA(plan, Result))
1181+
if (IsA(plan, Result) || IsA(plan, Sort))
11821182
return false;
11831183

11841184
/*

0 commit comments

Comments
 (0)