- Notifications
You must be signed in to change notification settings - Fork5
Commitdcc2334
committed
Consider a clause to be outerjoin_delayed if it references the nullable side
of any lower outer join, even if it also references the non-nullable side andso could not get pushed below the outer join anyway. We need this in casethe clause is an OR clause: if it doesn't get marked outerjoin_delayed,create_or_index_quals() could pull an indexable restriction for the nullableside out of it, leading to wrong results as demonstrated by today's bugreport from toruvinn. (See added regression test case for an example.)In principle this has been wrong for quite a while. In practice I don'tthink any branch before 8.3 can really show the failure, becausecreate_or_index_quals() will only pull out indexable conditions, and before8.3 those were always strict. So though we might have improperly generatednull-extended rows in the outer join, they'd get discarded from the resultanyway. The gating factor that makes the failure visible is that 8.3considers "col IS NULL" to be indexable. Hence I'm not going to riskback-patching further than 8.3.1 parentf6c1dec commitdcc2334
File tree
4 files changed
+38
-3
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
4 files changed
+38
-3
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1092 | 1092 |
| |
1093 | 1093 |
| |
1094 | 1094 |
| |
1095 |
| - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
1096 | 1098 |
| |
1097 | 1099 |
| |
1098 | 1100 |
| |
1099 | 1101 |
| |
1100 | 1102 |
| |
1101 | 1103 |
| |
1102 |
| - | |
1103 | 1104 |
| |
1104 | 1105 |
| |
1105 | 1106 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2321 | 2321 |
| |
2322 | 2322 |
| |
2323 | 2323 |
| |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + |
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2321 | 2321 |
| |
2322 | 2322 |
| |
2323 | 2323 |
| |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + |
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
485 | 485 |
| |
486 | 486 |
| |
487 | 487 |
| |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + |
0 commit comments
Comments
(0)