Bug #74901 | UTF8 LIKE query with wildcard and escape character produce incorrect result | ||
---|---|---|---|
Submitted: | 17 Nov 2014 13:10 | Modified: | 11 Apr 2018 10:44 |
Reporter: | A R | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S3 (Non-critical) |
Version: | 5.5.40, 5.6.23 | OS: | Linux (Ubuntu 14.10) |
Assigned to: | CPU Architecture: | Any |
[17 Nov 2014 13:10]
A R
[19 Dec 2014 22:29]
Sveta Smirnova
Thank you for the report. Verified as described. Workaround: use collation utf8_general_ci. mysql> show variables like '%col%'; +---------------------------+-------------------+ | Variable_name | Value | +---------------------------+-------------------+ | collation_connection | utf8_unicode_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | | protocol_version | 10 | | slave_compressed_protocol | OFF | +---------------------------+-------------------+ 5 rows in set (0.00 sec) mysql> select _utf8'10% off!' collate utf8_unicode_ci like '%!%ff%' escape '!'; +------------------------------------------------------------------+ | _utf8'10% off!' collate utf8_unicode_ci like '%!%ff%' escape '!' | +------------------------------------------------------------------+ | 1 | +------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> select _utf8'10% off!' collate utf8_general_ci like '%!%ff%' escape '!'; +------------------------------------------------------------------+ | _utf8'10% off!' collate utf8_general_ci like '%!%ff%' escape '!' | +------------------------------------------------------------------+ | 0 | +------------------------------------------------------------------+ 1 row in set (0.00 sec)
[11 Apr 2018 10:44]
Erlend Dahl
This was fixed in 8.0.1.