@@ -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