@@ -1149,10 +1149,10 @@ mark_async_capable_plan(Plan *plan, Path *path)
1149
1149
SubqueryScan * scan_plan = (SubqueryScan * ) plan ;
1150
1150
1151
1151
/*
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.
1154
1154
*/
1155
- if (IsA (plan , Result ))
1155
+ if (IsA (plan , Result ) || IsA ( plan , Sort ) )
1156
1156
return false;
1157
1157
1158
1158
/*
@@ -1170,10 +1170,10 @@ mark_async_capable_plan(Plan *plan, Path *path)
1170
1170
FdwRoutine * fdwroutine = path -> parent -> fdwroutine ;
1171
1171
1172
1172
/*
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.
1175
1175
*/
1176
- if (IsA (plan , Result ))
1176
+ if (IsA (plan , Result ) || IsA ( plan , Sort ) )
1177
1177
return false;
1178
1178
1179
1179
Assert (fdwroutine != NULL );
@@ -1186,9 +1186,9 @@ mark_async_capable_plan(Plan *plan, Path *path)
1186
1186
1187
1187
/*
1188
1188
* 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.
1190
1190
*/
1191
- if (IsA (plan , Result ))
1191
+ if (IsA (plan , Result ) || IsA ( plan , Sort ) )
1192
1192
return false;
1193
1193
1194
1194
/*
0 commit comments