[MDEV-32090] Index does not handle null-safe equals operator correctly in join Created: 2023-09-04 Updated: 2024-01-17 Resolved: 2024-01-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Storage Engine - InnoDB |
| Affects Version/s: | 10.9, 10.10, 10.11, 11.0, 11.1, 11.2.1 |
| Fix Version/s: | 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Pim Broekhof | Assignee: | Dave Gosselin |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | wrong_result | ||
| Issue Links: |
|
||||||||
| Description |
|
A table with an index with nullable fields does not correctly handle the "<=>" null-safe equals operator when used in an inner join "on" clause. This issue does not seem to occur in version 11.0.2. Setup:
The following query is expected to return one row, but instead returns no rows:
Expected: 1 row "id: 100733476" The same query without using the "streetNumber" index does return a single row:
Expected: 1 row "id: 100733476" The same query with <=> operator replaced with an equivalent expression does return a single row:
Expected: 1 row "id: 100733476" |
| Comments |
| Comment by Alice Sherepa [ 2023-09-13 ] | ||||||||||||||||||||||||||||||||||||
|
Thank you for the report!
| ||||||||||||||||||||||||||||||||||||
| Comment by Pim Broekhof [ 2024-01-05 ] | ||||||||||||||||||||||||||||||||||||
|
Is there any movement on this issue? This bug basically forbids the use of the "<=>" operator if you want correct results. | ||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
not reproducible on current 10.11-11.3, fixed by b9e210bbf3 commit ( | ||||||||||||||||||||||||||||||||||||
| Comment by Pim Broekhof [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
The original description incorrectly listed 11.0.3 as the last good version, but that should've been 11.0.2. It seems to have been fixed in 11.0.4 using the example above, great! I can still reproduce it in 11.0.3. | ||||||||||||||||||||||||||||||||||||
| Comment by Dave Gosselin [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
alice I was just narrowing down the commits | ||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
Gosselin I guess yes, the only reason why I didn't close it - I'm always in doubt about whether it is worth adding the test case for mtr. | ||||||||||||||||||||||||||||||||||||
| Comment by Dave Gosselin [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
alice that is a good point. Since it is assigned to me, I will add a test case for mtr and go through the usual review and delivery process. Thanks! | ||||||||||||||||||||||||||||||||||||
| Comment by Dave Gosselin [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
Latest 10.11 at git sha bdf65893ddb2ce0552a20e53e2358350521d2d35 works correctly, so the Fixed Versions field may be incorrect. As Alice noted earlier, this is a duplicate of another issue. I'll use this ticket to deliver a test for mtr to 10.11. | ||||||||||||||||||||||||||||||||||||
| Comment by Dave Gosselin [ 2024-01-08 ] | ||||||||||||||||||||||||||||||||||||
|
For whatever reason, Jira isn't picking up the PR, so I'm linking it here: |