forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitab24022
committed
Fix generation of EC join conditions at the wrong plan level.
get_baserel_parampathinfo previously assumed without checking thatthe results of generate_join_implied_equalities "necessarily satisfyjoin_clause_is_movable_into". This turns out to be wrong in thepresence of outer joins, because the generated clauses could includeVars that mustn't be evaluated below a relevant outer join. Thatled to applying clauses at the wrong plan level and possibly gettingincorrect query results. We must check each clause's nullable_relids,and really the right thing to do is test join_clause_is_movable_into.However, trying to fix it that way exposes an oversight inequivclass.c: it wasn't careful about marking join clauses forappendrel children with the correct clause_relids. That caused themodified get_baserel_parampathinfo code to reject some clauses itstill needs to accept. (See parallel commit for HEAD/v16 for morecommentary about that.)Per bug #18429 from Benoît Ryder. This misbehavior existed fora long time before commit2489d76, so patch v12-v15 this way.Discussion:https://postgr.es/m/18429-8982d4a348cc86c6@postgresql.org1 parent6fa5e67 commitab24022
File tree
4 files changed
+83
-7
lines changed- src
- backend/optimizer
- path
- util
- test/regress
- expected
- sql
4 files changed
+83
-7
lines changedLines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1880 | 1880 |
| |
1881 | 1881 |
| |
1882 | 1882 |
| |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
1883 | 1898 |
| |
1884 | 1899 |
| |
1885 | 1900 |
| |
|
Lines changed: 18 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1297 | 1297 |
| |
1298 | 1298 |
| |
1299 | 1299 |
| |
| 1300 | + | |
1300 | 1301 |
| |
1301 | 1302 |
| |
1302 | 1303 |
| |
| |||
1330 | 1331 |
| |
1331 | 1332 |
| |
1332 | 1333 |
| |
1333 |
| - | |
1334 |
| - | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1335 | 1338 |
| |
1336 |
| - | |
1337 |
| - | |
1338 |
| - | |
1339 |
| - | |
1340 |
| - | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1341 | 1352 |
| |
1342 | 1353 |
| |
1343 | 1354 |
| |
|
Lines changed: 31 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5949 | 5949 |
| |
5950 | 5950 |
| |
5951 | 5951 |
| |
| 5952 | + | |
| 5953 | + | |
| 5954 | + | |
| 5955 | + | |
| 5956 | + | |
| 5957 | + | |
| 5958 | + | |
| 5959 | + | |
| 5960 | + | |
| 5961 | + | |
| 5962 | + | |
| 5963 | + | |
| 5964 | + | |
| 5965 | + | |
| 5966 | + | |
| 5967 | + | |
| 5968 | + | |
| 5969 | + | |
| 5970 | + | |
| 5971 | + | |
| 5972 | + | |
| 5973 | + | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | + | |
| 5979 | + | |
| 5980 | + | |
| 5981 | + | |
| 5982 | + | |
5952 | 5983 |
| |
5953 | 5984 |
| |
5954 | 5985 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2029 | 2029 |
| |
2030 | 2030 |
| |
2031 | 2031 |
| |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
2032 | 2051 |
| |
2033 | 2052 |
| |
2034 | 2053 |
| |
|
0 commit comments
Comments
(0)