- Notifications
You must be signed in to change notification settings - Fork28
Commitb971a98
committed
Fix placement of initPlans when forcibly materializing a subplan.
If we forcibly place a Material node atop a finished subplan, we needto move any initPlans attached to the subplan up to the Material node,in order to keep SS_finalize_plan() happy. I'd figured this out incommit7b67a0a for the case of materializing a cursor plan, but out ofan abundance of caution, I put the initPlan movement hack at the callsite for that case, rather than inside materialize_finished_plan().That was the wrong thing, because it turns out to also be necessary forthe only other caller of materialize_finished_plan(), ie subselect.c.We lacked any test cases that exposed the mistake, but bug#14524 fromWei Congrui shows that it's possible to get an initPlan reference intothe top tlist in that case too, and then SS_finalize_plan() complains.Hence, move the hack into materialize_finished_plan().In HEAD, also relocate some recently-added tests in subselect.sql, whichI'd unthinkingly dropped into the middle of a sequence of related tests.Report:https://postgr.es/m/20170202060020.1400.89021@wrigleys.postgresql.org1 parent3aab31b commitb971a98
File tree
4 files changed
+39
-15
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
4 files changed
+39
-15
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5629 | 5629 |
| |
5630 | 5630 |
| |
5631 | 5631 |
| |
| 5632 | + | |
| 5633 | + | |
| 5634 | + | |
| 5635 | + | |
| 5636 | + | |
| 5637 | + | |
| 5638 | + | |
| 5639 | + | |
| 5640 | + | |
| 5641 | + | |
5632 | 5642 |
| |
5633 | 5643 |
| |
5634 | 5644 |
| |
|
Lines changed: 1 addition & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
305 | 305 |
| |
306 | 306 |
| |
307 | 307 |
| |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
314 |
| - | |
315 |
| - | |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
| 308 | + | |
323 | 309 |
| |
324 | 310 |
| |
325 | 311 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
221 | 221 |
| |
222 | 222 |
| |
223 | 223 |
| |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
224 | 247 |
| |
225 | 248 |
| |
226 | 249 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 |
| |
96 | 101 |
| |
97 | 102 |
| |
|
0 commit comments
Comments
(0)