Bug #45517 | Searching with umlaut (latin1_german2_ci) with LIKE | ||
---|---|---|---|
Submitted: | 16 Jun 2009 8:27 | Modified: | 30 Jun 2009 6:09 |
Reporter: | Richard Teubel | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S2 (Serious) |
Version: | 5.0.45 5.0.83 5.1.35 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | latin1_german2_ci, like, umlaut |
[16 Jun 2009 8:27]
Richard Teubel
[16 Jun 2009 8:54]
Sveta Smirnova
Thank you for the report. But version 5.0.45 is old. Please try with current version 5.0.83 and if problem still exists provide output of: show variables like 'char%'; show variables like 'coll%';
[16 Jun 2009 10:49]
Richard Teubel
The same problem also in version 5.0.83 and 5.1.35. mysql> select version(); +------------+ | version() | +------------+ | 5.0.83-log | +------------+ 1 row in set (0.00 sec) mysql> show variables like 'char%'; +--------------------------+----------------------------------------------------------------------+ | Variable_name | Value | +--------------------------+----------------------------------------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql-5.0.83-linux-i686-icc-glibc23/share/mysql/charsets/ | +--------------------------+----------------------------------------------------------------------+ 8 rows in set (0.00 sec) mysql> show variables like 'coll%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | latin1_swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_german2_ci | +----------------------+-------------------+ 3 rows in set (0.00 sec) mysql> set collation_connection =latin1_german2_ci; Query OK, 0 rows affected (0.00 sec) mysql> ALTER DATABASE `test_latin1_german2_ci` DEFAULT CHARACTER SET latin1 COLLATE latin1_german2_ci; Query OK, 1 row affected (0.00 sec) mysql> show variables like 'coll%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | latin1_german2_ci | | collation_database | latin1_german2_ci | | collation_server | latin1_german2_ci | +----------------------+-------------------+ 3 rows in set (0.00 sec) mysql> SELECT ID FROM Wordlist WHERE word LIKE "Blaubaer"; Empty set (0.00 sec)
[30 Jun 2009 6:09]
Susanne Ebrecht
Many thanks for writing a bug report. Unfortunately, this is not a bug. DIN 5007-2 says, for Germany 'ä' and 'ae' are equal (http://de.wikipedia.org/wiki/DIN_5007) This means: SELECT 'ä' = 'ae'; => TRUE The SQL Standard says that the command 'LIKE' should perform matching on a per-character basis. So for the command 'LIKE' 'ä' and 'ae' are different. http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html