Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
Description
This bug is very similar to MDEV-8625.
The script with no index:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_german2_ci);
|
INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ä');
|
SELECT * FROM t1 WHERE a<='ae';
|
and the script with KEY(a):
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_german2_ci, KEY(a));
|
INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ä');
|
SELECT * FROM t1 WHERE a<='ae';
|
correctly return two rows:
+------+
|
| a |
|
+------+
|
| a |
|
| ä |
|
+------+
|
This script with KEY(a(1)):
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_german2_ci, KEY(a(1)));
|
INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ä');
|
SELECT * FROM t1 WHERE a<='ae';
|
erroneously returns only one row:
+------+
|
| a |
|
+------+
|
| a |
|
+------+
|
The problem happens because when building a search value for the prefix key lookup, the character combination 'ae' (which is equal to 'ä') is broken apart and only the leading letter 'a' is stored into the search value.
Attachments
Issue Links
- relates to
-
MDEV-8625 Bad result set with ignorable characters when using a prefix key
- Confirmed
-
MDEV-20884 Different resultset when using prefix index and utf8mb4
- Confirmed
-
MDEV-34611 INNER JOIN returns incorrect results
- Stalled