[MDEV-8705] Wrong result for SELECT..WHERE latin1_bin_column='a' AND latin1_bin_column='A' Created: 2015-08-30 Updated: 2015-09-12 Resolved: 2015-09-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | propagation, upstream | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
This script:
erroneously returns one row:
The expected result is empty set. If I change the order in WHERE:
it erroneously returns one row again, but a different row:
The problem happens in Item_equal::add_const(). It does not take into account collation of the field and compares the two string literals using the current session collation, which is latin1_swedish_ci. A related problem:
The first and the second SELECT queries correctly return one row.
It should return one row. |