Bug #20353 Prefix key search return incorrect results for ignorable characters
| Submitted: | 9 Jun 2006 11:12 | Modified: | 24 Nov 2008 15:30 |
|---|---|---|---|
| Reporter: | Alexander Barkov | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Charsets | Severity: | S3 (Non-critical) |
| Version: | 4.1, 5.0, 5.1 | OS: | Any |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
[9 Jun 2006 11:12]
Alexander Barkov
[9 Jun 2006 11:16]
Alexander Barkov
Changing priority to P2, as SELECT returns wrong result set.
[8 Dec 2006 16:39]
Jonathan Miller
Hi, I created a test case for this bug and will be commiting it soon, but the results of the test shows that there maybe some other issues here as well. + Note 1051 Unknown table 't1' + CREATE TABLE t1 (a varchar(128)) character set utf8 collate utf8_unicode_ci; + "Full Row Count" + SELECT COUNT(*) FROM t1; + COUNT(*) + 444 There are 444 rows that have ignorable character. When doing a SELECT w/o and keys, only 109 are returned. + + "Count w/o key where a='aaaa';" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 109 + When adding the prefix, only one row is returned until we have a prefix key of (a(5) + "Count w/ Perfix Key (a(1))" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 1 + + "Count w/ Perfix Key (a(2))" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 1 + + "Count w/ Perfix Key (a(3))" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 1 + + "Count w/ Perfix Key (a(4))" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 1 + + "Count w/ Perfix Key (a(5))" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 77 Even with a full key, we are only getting back 109. + + "Count w/ Full Key" + SELECT COUNT(*) FROM t1 WHERE a='aaaa'; + COUNT(*) + 109 + /jeb
[8 Dec 2006 16:42]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/16673 ChangeSet@1.2376, 2006-12-08 17:41:49+01:00, jmiller@mysql.com +2 -0 prefix_key_search.result, prefix_key_search.test: Test case for Bug #20353 Prefix key search return incorrect results for ignorable characters
[11 Dec 2006 11:43]
Alexander Barkov
The list of primary ignorable characters
Attachment: bad-keys.txt (text/plain), 31.80 KiB.
[11 Dec 2006 15:24]
Jonathan Miller
Hi Bar, I am glad that you like the test case. You can make the changes if you wish, or I can correct it per your description and resubmit for you. Either way. Please let me know. Best wishes, /Jeb
[9 Dec 2008 16:33]
Omer Barnir
triage: changing tag from SR60BETA to SR61BTA as bug should be pushed to 6.x (see above comment)
[4 Nov 9:21]
Øystein Grøvlen
Posted by developer: Newer collations still reproduce the bug. On MySQL 26.10.0, I tested: - utf8mb4_unicode_520_ci - utf8mb4_0900_ai_ci - utf8mb4_0900_as_ci - utf8mb4_0900_as_cs All return one row instead of two for the original prefix-index query. Scans and full-column index lookups return both rows correctly. The accent-sensitive collations distinguish the combining-accent example correctly, but still fail for the original leading U+0001 character. Switching collations therefore does not resolve this bug.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.047 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.