Bug #12997 | 'like' and '\' | ||
---|---|---|---|
Submitted: | 5 Sep 2005 17:59 | Modified: | 5 Sep 2005 19:04 |
Reporter: | Pavel Skuratovich | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.14-nt | OS: | Windows (Windows 2000 Server) |
Assigned to: | CPU Architecture: | Any |
[5 Sep 2005 17:59]
Pavel Skuratovich
[5 Sep 2005 19:04]
Andrey Hristov
Use SQL mode NO_BACKSLASH_ESCAPES. http://dev.mysql.com/doc/mysql/en/server-sql-mode.html "Disable the use of the backslash character (‘\’) as an escape character within strings. With this mode enabled, backslash becomes any ordinary character like any other. (New in MySQL 5.0.1)" set @@sql_mode=NO_BACKSLASH_ESCAPES;
[5 Sep 2005 21:00]
Pavel Skuratovich
but even if backslash is escape character, '\\\\\\\\' should represent '\\\\', _not_ '\\'!
[21 Sep 2005 8:16]
Sergei Golubchik
Check the description of LIKE in the manual, it explains why you need double-escaping