forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit45f8eaa
committed
Fix improper interaction of FULL JOINs with lateral references.
join_is_legal() needs to reject forming certain outer joins in caseswhere that would lead the planner down a blind alley. However, itmistakenly supposed that the way to handle full joins was to treat themas applying the same constraints as for left joins, only to both sides.That doesn't work, as shown in bug #15741 from Anthony Skorski: givena lateral reference out of a join that's fully enclosed by a full join,the code would fail to believe that any join ordering is legal, resultingin errors like "failed to build any N-way joins".However, we don't really need to consider full joins at all for thispurpose, because we effectively force them to be evaluated in syntacticorder, and that order is always legal for lateral references. Hence,get rid of this broken logic for full joins and just ignore them instead.This seems to have been an oversight in commit7e19db0.Back-patch to all supported branches, as that was.Discussion:https://postgr.es/m/15741-276f1f464b3f40eb@postgresql.org1 parentc660003 commit45f8eaa
File tree
3 files changed
+44
-9
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+44
-9
lines changedLines changed: 4 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
623 | 623 |
| |
624 | 624 |
| |
625 | 625 |
| |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
626 | 630 |
| |
627 | 631 |
| |
628 | 632 |
| |
629 | 633 |
| |
630 | 634 |
| |
631 | 635 |
| |
632 | 636 |
| |
633 |
| - | |
634 |
| - | |
635 |
| - | |
636 |
| - | |
637 |
| - | |
638 |
| - | |
639 |
| - | |
640 |
| - | |
641 |
| - | |
642 | 637 |
| |
643 | 638 |
| |
644 | 639 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1391 | 1391 |
| |
1392 | 1392 |
| |
1393 | 1393 |
| |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
1394 | 1419 |
| |
1395 | 1420 |
| |
1396 | 1421 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
322 | 337 |
| |
323 | 338 |
| |
324 | 339 |
| |
|
0 commit comments
Comments
(0)