- Notifications
You must be signed in to change notification settings - Fork4.9k
Commiteb9d1f0
committed
Repair more failures with SubPlans in multi-row VALUES lists.
Commit9b63c13 turns out to have been fundamentally misguided:the parent node's subPlan list is by no means the only way in whicha child SubPlan node can be hooked into the outer execution state.As shown in bug #16213 from Matt Jibson, we can also get short-livedtuple table slots added to the outer es_tupleTable list. At this pointI have little faith that there aren't other possible connections aswell; the long time it took to notice this problem shows that thisisn't a heavily-exercised situation.Therefore, revert that fix, returning to the coding that passed aNULL parent plan pointer down to the transiently-built subexpressions.That gives us a pretty good guarantee that they won't hook into theouter executor state in any way. But then we need some other solutionto make SubPlans work. Adopt the solution speculated about in theprevious commit's log message: do expression initialization at planstartup for just those VALUES rows containing SubPlans, abandoning thegoal of reclaiming memory intra-query for those rows. In practice itseems unlikely that queries containing a vast number of VALUES rowswould be using SubPlans in them, so this should not give up much.(BTW, this test case also refutes my claim in connection with the priorcommit that the issue only arises with use of LATERAL. That was justwrong: some variants of SubLink always produce SubPlans.)As with previous patch, back-patch to all supported branches.Discussion:https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org1 parent20a1dc1 commiteb9d1f0
File tree
4 files changed
+101
-34
lines changed- src
- backend/executor
- include/nodes
- test/regress
- expected
- sql
4 files changed
+101
-34
lines changedLines changed: 50 additions & 33 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
| |||
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
51 |
| - | |
| 52 | + | |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
| |||
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 | 69 |
| |
73 | 70 |
| |
74 | 71 |
| |
75 | 72 |
| |
76 | 73 |
| |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 | 74 |
| |
82 | 75 |
| |
83 | 76 |
| |
| |||
88 | 81 |
| |
89 | 82 |
| |
90 | 83 |
| |
91 |
| - | |
| 84 | + | |
| 85 | + | |
92 | 86 |
| |
| 87 | + | |
| 88 | + | |
93 | 89 |
| |
94 |
| - | |
95 |
| - | |
96 | 90 |
| |
97 | 91 |
| |
98 | 92 |
| |
| |||
106 | 100 |
| |
107 | 101 |
| |
108 | 102 |
| |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
| 103 | + | |
113 | 104 |
| |
114 | 105 |
| |
115 | 106 |
| |
116 | 107 |
| |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
126 | 114 |
| |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
133 | 125 |
| |
134 | 126 |
| |
135 | 127 |
| |
| |||
261 | 253 |
| |
262 | 254 |
| |
263 | 255 |
| |
264 |
| - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
265 | 266 |
| |
266 | 267 |
| |
| 268 | + | |
| 269 | + | |
267 | 270 |
| |
268 | 271 |
| |
269 | 272 |
| |
270 |
| - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
271 | 288 |
| |
272 | 289 |
| |
273 | 290 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1432 | 1432 |
| |
1433 | 1433 |
| |
1434 | 1434 |
| |
1435 |
| - | |
| 1435 | + | |
| 1436 | + | |
1436 | 1437 |
| |
1437 | 1438 |
| |
1438 | 1439 |
| |
| |||
1441 | 1442 |
| |
1442 | 1443 |
| |
1443 | 1444 |
| |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
1444 | 1451 |
| |
1445 | 1452 |
| |
1446 | 1453 |
| |
| |||
1451 | 1458 |
| |
1452 | 1459 |
| |
1453 | 1460 |
| |
| 1461 | + | |
| 1462 | + | |
1454 | 1463 |
| |
1455 | 1464 |
| |
1456 | 1465 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
740 | 740 |
| |
741 | 741 |
| |
742 | 742 |
| |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
743 | 770 |
| |
744 | 771 |
| |
745 | 772 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
422 | 422 |
| |
423 | 423 |
| |
424 | 424 |
| |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
425 | 439 |
| |
426 | 440 |
| |
427 | 441 |
| |
|
0 commit comments
Comments
(0)