forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit91800af
committed
Ensure generated join clauses for child rels have correct relids.
When building a join clause derived from an EquivalenceClass, if theclause is to be used with an appendrel child relation then make sureits clause_relids include the relids of that child relation.Normally this would be true already because the EquivalenceMemberwould be a Var of that relation. However, if the appendrel representsa flattened UNION ALL construct then some child EquivalenceMemberscould be constants with no relids. The resulting under-marked clauseis problematic because it could mislead join_clause_is_movable_intoabout where the clause should be evaluated. We do not have an exampleshowing incorrect plan generation, but there are existing cases inthe regression tests that will fail the Asserts this patch adds toget_baserel_parampathinfo. A similarly wrong conclusion about aclause being considered by get_joinrel_parampathinfo would lead towrong placement of the clause. (This also squares with the waythat clause_relids is calculated for non-equijoin clauses inadjust_appendrel_attrs.)The other reason for wanting these new Asserts is that the previousblithe assumption that the results of generate_join_implied_equalities"necessarily satisfy join_clause_is_movable_into" turns out to bewrong pre-v16. If it's still wrong it'd be good to find out.Per bug #18429 from Benoît Ryder. The bug as filed was fixed bycommit2489d76, but these changes correlate with the fix wewill need to apply in pre-v16 branches.Discussion:https://postgr.es/m/18429-8982d4a348cc86c6@postgresql.org1 parent7c93f31 commit91800af
2 files changed
+34
-7
lines changedLines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1885 | 1885 |
| |
1886 | 1886 |
| |
1887 | 1887 |
| |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
1888 | 1903 |
| |
1889 | 1904 |
| |
1890 | 1905 |
| |
|
Lines changed: 19 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1535 | 1535 |
| |
1536 | 1536 |
| |
1537 | 1537 |
| |
| 1538 | + | |
1538 | 1539 |
| |
1539 | 1540 |
| |
1540 | 1541 |
| |
| |||
1570 | 1571 |
| |
1571 | 1572 |
| |
1572 | 1573 |
| |
1573 |
| - | |
| 1574 | + | |
| 1575 | + | |
1574 | 1576 |
| |
1575 |
| - | |
1576 |
| - | |
1577 |
| - | |
1578 |
| - | |
1579 |
| - | |
1580 |
| - | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1581 | 1593 |
| |
1582 | 1594 |
| |
1583 | 1595 |
| |
|
0 commit comments
Comments
(0)