I have a database in which we store user names with the first capital letter of each name, i.e.IsaacSparling. I am trying to make case-insensitive autocomplete against my MySQL (v5.1.46) db. The table has UTF8 encoding and utf8_unicode_ci mapping. I also did these tests compared to setting utf8_general_ci.
Plain ASCII text works fine:
mysql> select username from users where username like 'j%'; +----------------+ | username | +----------------+ | J******** | | J*********** | | J************* | +----------------+ 3 rows in set (0.00 sec) mysql> select username from users where username like 'J%'; +----------------+ | username | +----------------+ | J******** | | J*********** | | J************* | +----------------+ 3 rows in set (0.00 sec)
(names changed, but they are).
However, when I try to do the same for Unicode characters outside of ASCII, there is no such luck:
mysql> select username from users where username like 'ø%'; Empty set (0.00 sec) mysql> select username from users where username like 'Ø%'; +-------------+ | username | +-------------+ | Ø********* | +-------------+ 1 row in set (0.00 sec)
Some research led me to the following: http://bugs.mysql.com/bug.php?id=19567 (tl; dr, this is a known error with Unicode sorts and the correction is in the priority of the "new function", i.e. will not be completed in any reasonable timeframe).
Has anyone found any efficient workarounds that allow case-insensitive search for Unicode characters in MySQL? Any thoughts appreciated!
source share