Bug #68828 | search on specific string return no result | ||
---|---|---|---|
Submitted: | 1 Apr 2013 19:42 | Modified: | 2 Apr 2013 4:59 |
Reporter: | sebastien Roux | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Storage Engines | Severity: | S2 (Serious) |
Version: | 5.5.30 | OS: | Linux (Debian 2.6.32-5-686) |
Assigned to: | CPU Architecture: | Any | |
Tags: | like, protected value, search |
[1 Apr 2013 19:42]
sebastien Roux
[1 Apr 2013 22:31]
MySQL Verification Team
See here: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html "Because MySQL uses C escape syntax in strings (for example, “\n” to represent a newline character), you must double any “\” that you use in LIKE strings. For example, to search for “\n”, specify it as “\\n”. To search for “\”, specify it as “\\\\”; this is because the backslashes are stripped once by the parser and again when the pattern match is made, leaving a single backslash to be matched against." mysql> SELECT * FROM `mytab` WHERE `caption` LIKE "%./\\\\.%"; +------------+---------+ | identifier | caption | +------------+---------+ | 1 | ./\. | +------------+---------+ 1 row in set (0.00 sec)
[2 Apr 2013 4:59]
sebastien Roux
Ok, Thanks for your quick answer. I will do that