Bug #6019 | SELECT tries to use too short prefix index on utf8 data | ||
---|---|---|---|
Submitted: | 11 Oct 2004 12:03 | Modified: | 29 Oct 2004 8:00 |
Reporter: | Marko Mäkelä | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.6-bk | OS: | Linux (GNU/Linux) |
Assigned to: | Sergei Golubchik | CPU Architecture: | Any |
[11 Oct 2004 12:03]
Marko Mäkelä
[11 Oct 2004 12:16]
Marko Mäkelä
Whoever fixes this bug should also consider adding an extra 0xff byte to the upper limit of the search area. Otherwise, if there are 3-byte UTF8 characters that are equivalent with 1-byte or 2-byte UTF8 characters, the search results may be inconsistent. See the function my_strnncoll_utf8(). There, the end of string is treated as the 'infimum' character and 0xff (an illegal UTF8 character) is treated as the 'supremum'. Thus, "foo" < "foobar" but "foo\xff" > "foobar". Now consider the case where "foo" consists of 3-byte UTF8 characters. It is best to pad the upper limit of the LIKE prefix search with an extra 0xff byte, i.e., "foo\xff".
[11 Oct 2004 19:03]
MySQL Verification Team
Verified with 4.1.6-gamma-debug-log
[15 Oct 2004 10:05]
Alexander Barkov
I fixed the bug in MySQL code, so InnoDB now works fine. But there is still a problem with BDB, I'm continueing working on it.
[29 Oct 2004 8:00]
Sergei Golubchik
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: fixed in 4.1.7