[MCOL-4715] Mixed inner and outer joins with "null filter" for the table which is not involved into the outer join produces wrong results. Created: 2021-05-11 Updated: 2023-11-14 Resolved: 2022-09-06 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 22.08.1 |
| Type: | New Feature | Priority: | Blocker |
| Reporter: | Gagan Goel (Inactive) | Assignee: | Denis Khalikov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Assigned for Review: | |
| Assigned for Testing: | |
| Description |
|
The following query produces expected result:
However, if we apply an 'is null' WHERE predicate to the above query, we get incorrect result:
The expected result is the below (here, i1, i2, i3 are equivalent InnoDB tables):
|
| Comments |
| Comment by Gagan Goel (Inactive) [ 2021-05-18 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Here are 2 additional cases that produce incorrect results:
Bad result:
Expected result:
Bad result:
Expected result:
| ||||||||||||||||||||||||||||||||||||||||||
| Comment by alexey vorovich (Inactive) [ 2022-08-05 ] | ||||||||||||||||||||||||||||||||||||||||||
|
toddstoffel and tntnatbry If we correct it to a rational form we are good
I wonder if this is urgent ?? ?? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Gagan Goel (Inactive) [ 2022-08-05 ] | ||||||||||||||||||||||||||||||||||||||||||
|
alexey.vorovich In the original query:
Here, t2 left join t3 on t2.a=t3.a join is performed first. The results of this join are then used to perform the left join with t1 using the on clause t1.a=t3.a. So this is not a cartesian join. Vs in your query:
Here, t1 left join t2 on t1.a=t2.a is performed first. The results of this join are then used to perform the left join with t3 on t2.a=t3.a. These are just two different queries with different join orders, they should both individually give correct results. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2022-09-06 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 22.08 ($5531) Verified mentioned test case |