[MDEV-30325] Wrong result upon range query using index condition Created: 2023-01-02 Updated: 2023-01-17 Resolved: 2023-01-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Storage Engine - Aria |
| Affects Version/s: | 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2, 10.11.1 |
| Fix Version/s: | 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Description |
|
It's possible that the problem is not caused by the selectivity work in 11.0, and the faulty plan can be somehow triggered on older versions, but since I couldn't so far achieve it, I will assume the relation to the changes.
Plan:
The expected result is apparently 5658. I didn't count the rows myself, but 5658 is what
Also, even the 2nd part of the OR condition alone already returns over 5K rows, so 5658 seems to be plausible.
|
| Comments |
| Comment by Michael Widenius [ 2023-01-04 ] |
|
This is a bug that affects most MariaDB versions. The original test failed in 11.0 as it uses 'range' instead of 'all'. The reason for this was a bug in opt_range.cc:key_or(), where the combination of two index + NOT IN caused a uncommon code path to be taken which was missing a piece of code. |
| Comment by Michael Widenius [ 2023-01-05 ] |
|
Fixed |