forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitebb7902
Etsuro Fujita
Disable asynchronous execution if using gating Result nodes.
mark_async_capable_plan(), which is called from create_append_plan() todetermine whether subplans are async-capable, failed to take intoaccount that the given subplan created from a given subpath mightinclude a gating Result node if the subpath is a SubqueryScanPath orForeignPath, causing a segmentation fault there when the subplan createdfrom a SubqueryScanPath includes the Result node, or causingExecAsyncRequest() to throw an error about an unrecognized node typewhen the subplan created from a ForeignPath includes the Result node,because in the latter case the Result node was unintentionallyconsidered as async-capable, but we don't currently support executingResult nodes asynchronously. Fix by modifying mark_async_capable_plan()to disable asynchronous execution in such cases. Also, adjust code inthe ProjectionPath case in mark_async_capable_plan(), for consistencywith other cases, and adjust/improve comments there.is_async_capable_path() added in commit27e1f14, which was rewrittento mark_async_capable_plan() in a later commit, has the same issue,causing the error at execution mentioned above, so back-patch to v14where the aforesaid commit went in.Per report from Justin Pryzby.Etsuro Fujita, reviewed by Zhihong Yu and Justin Pryzby.Discussion:https://postgr.es/m/20220408124338.GK24419%40telsasoft.com1 parent71f3946 commitebb7902
File tree
3 files changed
+44
-6
lines changed- contrib/postgres_fdw
- expected
- sql
- src/backend/optimizer/plan
3 files changed
+44
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10424 | 10424 | | |
10425 | 10425 | | |
10426 | 10426 | | |
| 10427 | + | |
| 10428 | + | |
| 10429 | + | |
| 10430 | + | |
| 10431 | + | |
| 10432 | + | |
| 10433 | + | |
| 10434 | + | |
| 10435 | + | |
| 10436 | + | |
| 10437 | + | |
| 10438 | + | |
| 10439 | + | |
| 10440 | + | |
| 10441 | + | |
| 10442 | + | |
| 10443 | + | |
| 10444 | + | |
| 10445 | + | |
| 10446 | + | |
| 10447 | + | |
| 10448 | + | |
| 10449 | + | |
| 10450 | + | |
| 10451 | + | |
| 10452 | + | |
10427 | 10453 | | |
10428 | 10454 | | |
10429 | 10455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3317 | 3317 | | |
3318 | 3318 | | |
3319 | 3319 | | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
3320 | 3325 | | |
3321 | 3326 | | |
3322 | 3327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | | - | |
1113 | | - | |
| 1112 | + | |
| 1113 | + | |
1114 | 1114 | | |
1115 | 1115 | | |
1116 | | - | |
| 1116 | + | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1124 | 1131 | | |
1125 | 1132 | | |
1126 | 1133 | | |
| |||
1295 | 1302 | | |
1296 | 1303 | | |
1297 | 1304 | | |
1298 | | - | |
1299 | | - | |
| 1305 | + | |
| 1306 | + | |
1300 | 1307 | | |
1301 | 1308 | | |
1302 | 1309 | | |
| |||
0 commit comments
Comments
(0)