forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1c72a8a
committed
Fix extremely nasty little bug observed when a sub-SELECT appears in
WHERE in a place where it can be part of a nestloop inner indexqual.As the code stood, it put the same physical sub-Plan node into bothindxqual and indxqualorig of the IndexScan plan node. That confusedlater processing in the optimizer (which expected that tracing thesubPlan list would visit each subplan node exactly once), and wouldprobably have blown up in the executor if the planner hadn't choked first.Fix by making the 'fixed' indexqual be a complete deep copy of theoriginal indexqual, rather than trying to share nodes below the topmostoperator node. This had further ramifications though, because we weremaking the aforesaid list of sub-Plan nodes during SS_process_sublinkswhich is run before construction of the 'fixed' indexqual, meaning thatthe copy of the sub-Plan didn't show up in that list. Fix by rearranginglogic so that the sub-Plan list is built by the final set_plan_referencespass, not in SS_process_sublinks. This may sound like a mess, but it'sactually a good deal cleaner now than it was before, because we are nolonger dependent on the assumption that planning will never make a copyof a sub-Plan node.1 parent8cdabf0 commit1c72a8a
File tree
7 files changed
+194
-134
lines changed- src
- backend
- nodes
- optimizer
- plan
- util
- include/optimizer
7 files changed
+194
-134
lines changedLines changed: 31 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 |
| - | |
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
| 91 | + | |
91 | 92 |
| |
92 |
| - | |
93 |
| - | |
| 93 | + | |
| 94 | + | |
94 | 95 |
| |
95 | 96 |
| |
96 | 97 |
| |
| |||
142 | 143 |
| |
143 | 144 |
| |
144 | 145 |
| |
145 |
| - | |
| 146 | + | |
146 | 147 |
| |
147 | 148 |
| |
148 | 149 |
| |
| |||
252 | 253 |
| |
253 | 254 |
| |
254 | 255 |
| |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
255 | 267 |
| |
256 | 268 |
| |
257 | 269 |
| |
| |||
358 | 370 |
| |
359 | 371 |
| |
360 | 372 |
| |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
361 | 380 |
| |
362 | 381 |
| |
363 | 382 |
| |
| |||
382 | 401 |
| |
383 | 402 |
| |
384 | 403 |
| |
385 |
| - | |
386 | 404 |
| |
387 | 405 |
| |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
388 | 413 |
| |
389 | 414 |
| |
390 | 415 |
| |
|
Lines changed: 11 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
724 | 724 |
| |
725 | 725 |
| |
726 | 726 |
| |
727 |
| - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
728 | 730 |
| |
729 | 731 |
| |
730 | 732 |
| |
| |||
808 | 810 |
| |
809 | 811 |
| |
810 | 812 |
| |
811 |
| - | |
812 |
| - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
813 | 818 |
| |
814 |
| - | |
815 |
| - | |
| 819 | + | |
816 | 820 |
| |
817 | 821 |
| |
818 | 822 |
| |
| |||
834 | 838 |
| |
835 | 839 |
| |
836 | 840 |
| |
837 |
| - | |
838 |
| - | |
839 |
| - | |
840 |
| - | |
841 |
| - | |
| 841 | + | |
842 | 842 |
| |
843 | 843 |
| |
844 | 844 |
| |
|
Lines changed: 32 additions & 51 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
| 63 | + | |
62 | 64 |
| |
63 | 65 |
| |
64 | 66 |
| |
| |||
72 | 74 |
| |
73 | 75 |
| |
74 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 |
| |
76 | 83 |
| |
77 | 84 |
| |
| |||
83 | 90 |
| |
84 | 91 |
| |
85 | 92 |
| |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
86 | 99 |
| |
87 | 100 |
| |
88 | 101 |
| |
89 | 102 |
| |
90 | 103 |
| |
91 | 104 |
| |
92 | 105 |
| |
| 106 | + | |
| 107 | + | |
| 108 | + | |
93 | 109 |
| |
94 | 110 |
| |
95 | 111 |
| |
96 | 112 |
| |
| 113 | + | |
| 114 | + | |
| 115 | + | |
97 | 116 |
| |
98 | 117 |
| |
99 | 118 |
| |
| |||
119 | 138 |
| |
120 | 139 |
| |
121 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
122 | 144 |
| |
123 | 145 |
| |
124 | 146 |
| |
| |||
136 | 158 |
| |
137 | 159 |
| |
138 | 160 |
| |
139 |
| - | |
| 161 | + | |
| 162 | + | |
140 | 163 |
| |
141 | 164 |
| |
142 | 165 |
| |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
143 | 172 |
| |
144 | 173 |
| |
145 | 174 |
| |
| |||
302 | 331 |
| |
303 | 332 |
| |
304 | 333 |
| |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
314 |
| - | |
315 |
| - | |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
| 334 | + | |
330 | 335 |
| |
331 | 336 |
| |
332 | 337 |
| |
| |||
383 | 388 |
| |
384 | 389 |
| |
385 | 390 |
| |
386 |
| - | |
387 |
| - | |
388 |
| - | |
389 |
| - | |
390 |
| - | |
391 |
| - | |
392 |
| - | |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
403 |
| - | |
404 |
| - | |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 | 391 |
| |
411 | 392 |
| |
412 | 393 |
| |
|
Lines changed: 11 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
442 | 442 |
| |
443 | 443 |
| |
444 | 444 |
| |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
445 | 451 |
| |
446 | 452 |
| |
447 | 453 |
| |
| |||
604 | 610 |
| |
605 | 611 |
| |
606 | 612 |
| |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
607 | 617 |
| |
608 | 618 |
| |
609 | 619 |
| |
| |||
670 | 680 |
| |
671 | 681 |
| |
672 | 682 |
| |
673 |
| - | |
674 |
| - | |
675 |
| - | |
676 |
| - | |
677 |
| - | |
678 |
| - | |
679 |
| - | |
680 |
| - | |
681 |
| - | |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
686 |
| - | |
687 |
| - | |
688 |
| - | |
689 |
| - | |
690 |
| - | |
691 |
| - | |
692 |
| - | |
693 |
| - | |
694 |
| - | |
695 |
| - | |
696 |
| - | |
697 |
| - | |
698 |
| - | |
699 |
| - | |
700 |
| - | |
701 |
| - |
0 commit comments
Comments
(0)