[MDEV-6978] Bad results with join comparing case insensitive VARCHAR/ENUM/SET expression to a _bin ENUM column Created: 2014-10-29 Updated: 2021-07-12 Resolved: 2021-07-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2.29, 10.1.44, 10.3.22, 10.4.12, 10.5.1 |
| Fix Version/s: | 10.0.15 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
This script correctly returns 2 rows for the both SELECT queries.
If I now add a primary key on t2 and rerun the queries again:
both queries return only one rows:
This is wrong. Two rows should always be returned. The same problem is repeatable if I change data type for t1.a from ENUM to VARCHAR(10) or SET('a'). |
| Comments |
| Comment by Igor Babaev [ 2020-03-01 ] | |||||||||||||||||||||||||
|
I've reopened this bug because I found a variant of the test case for
Now let's add one row
After this let's execute the query from your test case
We get the result
Now let's add more rows:
The query returns the same result set as expected.
Now the query returns a wrong result set
Note that now the query uses a plan different from that used in your test case after addition of the primary key. This plan employs a range index scan rather then a full index scan as in your test case.
I reproduced the problem in the current 10.4 and 10.1. All other versions most probably are also affected. | |||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-07-12 ] | |||||||||||||||||||||||||
|
closed again. new bug is moved to |