- Notifications
You must be signed in to change notification settings - Fork5
Commitb28ffd0
committed
Fix pushing of index-expression qualifications through UNION ALL.
In commit57664ed, I made the plannerwrap non-simple-variable outputs of appendrel children (IOW, child SELECTsof UNION ALL subqueries) inside PlaceHolderVars, in order to solve someissues with EquivalenceClass processing. However, this means that anyupper-level WHERE clauses mentioning such outputs will now containPlaceHolderVars after they're pushed down into the appendrel child,and that prevents indxpath.c from recognizing that they could be matchedto index expressions. To fix, add explicit stripping of PlaceHolderVarsfrom index operands, same as we have long done for RelabelType nodes.Add a regression test covering both this and the plain-UNION case (whichis a totally different code path, but should also be able to do it).Per bug #6416 from Matteo Beccati. Back-patch to 9.1, same as theprevious change.1 parented6e054 commitb28ffd0
File tree
4 files changed
+94
-1
lines changed- src
- backend/optimizer
- path
- plan
- test/regress
- expected
- sql
4 files changed
+94
-1
lines changedLines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2580 | 2580 |
| |
2581 | 2581 |
| |
2582 | 2582 |
| |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
2583 | 2592 |
| |
2584 | 2593 |
| |
2585 | 2594 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2673 | 2673 |
| |
2674 | 2674 |
| |
2675 | 2675 |
| |
2676 |
| - | |
| 2676 | + | |
| 2677 | + | |
2677 | 2678 |
| |
| 2679 | + | |
| 2680 | + | |
2678 | 2681 |
| |
2679 | 2682 |
| |
2680 | 2683 |
| |
|
Lines changed: 48 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
455 | 455 |
| |
456 | 456 |
| |
457 | 457 |
| |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + |
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + |
0 commit comments
Comments
(0)