forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd9e4ee7
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 parentbb418ae commitd9e4ee7
File tree
4 files changed
+83
-7
lines changed- src
- backend/optimizer
- path
- util
- test/regress
- expected
- sql
4 files changed
+83
-7
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1846 | 1846 |
| |
1847 | 1847 |
| |
1848 | 1848 |
| |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1849 | 1864 |
| |
1850 | 1865 |
| |
1851 | 1866 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1282 | 1282 |
| |
1283 | 1283 |
| |
1284 | 1284 |
| |
| 1285 | + | |
1285 | 1286 |
| |
1286 | 1287 |
| |
1287 | 1288 |
| |
| |||
1315 | 1316 |
| |
1316 | 1317 |
| |
1317 | 1318 |
| |
1318 |
| - | |
1319 |
| - | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
1320 | 1323 |
| |
1321 |
| - | |
1322 |
| - | |
1323 |
| - | |
1324 |
| - | |
1325 |
| - | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1326 | 1337 |
| |
1327 | 1338 |
| |
1328 | 1339 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5842 | 5842 |
| |
5843 | 5843 |
| |
5844 | 5844 |
| |
| 5845 | + | |
| 5846 | + | |
| 5847 | + | |
| 5848 | + | |
| 5849 | + | |
| 5850 | + | |
| 5851 | + | |
| 5852 | + | |
| 5853 | + | |
| 5854 | + | |
| 5855 | + | |
| 5856 | + | |
| 5857 | + | |
| 5858 | + | |
| 5859 | + | |
| 5860 | + | |
| 5861 | + | |
| 5862 | + | |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
| 5866 | + | |
| 5867 | + | |
| 5868 | + | |
| 5869 | + | |
| 5870 | + | |
| 5871 | + | |
| 5872 | + | |
| 5873 | + | |
| 5874 | + | |
| 5875 | + | |
5845 | 5876 |
| |
5846 | 5877 |
| |
5847 | 5878 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1999 | 1999 |
| |
2000 | 2000 |
| |
2001 | 2001 |
| |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
2002 | 2021 |
| |
2003 | 2022 |
| |
2004 | 2023 |
| |
|
0 commit comments
Comments
(0)