forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5aacfa6
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 parent689ba4f commit5aacfa6
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 | |
---|---|---|---|
| |||
1851 | 1851 |
| |
1852 | 1852 |
| |
1853 | 1853 |
| |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
1854 | 1869 |
| |
1855 | 1870 |
| |
1856 | 1871 |
| |
|
Lines changed: 18 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1300 | 1300 |
| |
1301 | 1301 |
| |
1302 | 1302 |
| |
| 1303 | + | |
1303 | 1304 |
| |
1304 | 1305 |
| |
1305 | 1306 |
| |
| |||
1333 | 1334 |
| |
1334 | 1335 |
| |
1335 | 1336 |
| |
1336 |
| - | |
1337 |
| - | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1338 | 1341 |
| |
1339 |
| - | |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1344 | 1355 |
| |
1345 | 1356 |
| |
1346 | 1357 |
| |
|
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)