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)