Commit acc5821
committed
Further fixes in qual nullingrel adjustment for outer join commutation.
One of the add_nulling_relids calls in deconstruct_distribute_oj_quals
added an OJ relid to too few Vars, while the other added it to too
many. We should consider the syntactic structure not
min_left/righthand while deciding which Vars to decorate, and when
considering pushing up a lower outer join pursuant to transforming the
second form of OJ identity 3 to the first form, we only want to
decorate Vars coming from its LHS.
In a related bug, I realized that make_outerjoininfo was failing to
check a very basic property that's needed to apply OJ identity 3:
the syntactically-upper outer join clause can't refer to the lower
join's LHS. This didn't break the join order restriction logic,
but it led to setting bogus commute_xxx bits, possibly resulting
in bogus nullingrel markings in modified quals.
Richard Guo and Tom Lane
Discussion: https://postgr.es/m/CAMbWs497CmBruMx1SOjepWEz+T5NWa4scqbdE9v7ZzSXqH_gQw@mail.gmail.com
Discussion: https://postgr.es/m/CAEP4nAx9C5gXNBfEA0JBfz7B+5f1Bawt-RWQWyhev-wdps8BZA@mail.gmail.com1 parent f8ba1bf commit acc5821
File tree
3 files changed
+50
-5
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+50
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1540 | 1540 | | |
1541 | 1541 | | |
1542 | 1542 | | |
1543 | | - | |
| 1543 | + | |
| 1544 | + | |
1544 | 1545 | | |
1545 | 1546 | | |
1546 | 1547 | | |
| |||
1985 | 1986 | | |
1986 | 1987 | | |
1987 | 1988 | | |
1988 | | - | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
1989 | 1996 | | |
1990 | 1997 | | |
1991 | 1998 | | |
1992 | 1999 | | |
1993 | | - | |
| 2000 | + | |
1994 | 2001 | | |
1995 | 2002 | | |
1996 | 2003 | | |
| |||
2041 | 2048 | | |
2042 | 2049 | | |
2043 | 2050 | | |
2044 | | - | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
2045 | 2056 | | |
2046 | 2057 | | |
2047 | 2058 | | |
2048 | 2059 | | |
2049 | | - | |
| 2060 | + | |
2050 | 2061 | | |
2051 | 2062 | | |
2052 | 2063 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5068 | 5068 | | |
5069 | 5069 | | |
5070 | 5070 | | |
| 5071 | + | |
| 5072 | + | |
| 5073 | + | |
| 5074 | + | |
| 5075 | + | |
| 5076 | + | |
| 5077 | + | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
| 5081 | + | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
| 5085 | + | |
| 5086 | + | |
| 5087 | + | |
| 5088 | + | |
| 5089 | + | |
| 5090 | + | |
| 5091 | + | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
5071 | 5096 | | |
5072 | 5097 | | |
5073 | 5098 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1820 | 1820 | | |
1821 | 1821 | | |
1822 | 1822 | | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
1823 | 1832 | | |
1824 | 1833 | | |
1825 | 1834 | | |
| |||
0 commit comments