Is there a way to disable the use of the backslash as an escape character in strings? I need to use an application that's designed to work on any database server supporting ANSI SQL. When it generates SQL insert/update queries, it doesn't escape backslashes in strings, because the ANSI SQL standard doesn't require backslashes to be escaped.

So to insert the value "\", the application generates the following query:
INSERT INTO (test) VALUES('\');
Which causes an error in MySQL because it thinks the \ is an escape character and the string is not closed.


If I modify the application to escape backslashes by replacing \ by \\, it works with MySQL, but with other databases that don't interpret the backslash as an escape character, it inserts two backslashes instead of one.

What could I do to tell MySQL it should interpret strings in the standard way?
I tried starting mysqld in ANSI mode (mysqld-max-nt --ansi) but it doesn't solve the problem.


I would also prefer a per-connection way to fix this, is there an option I can set when connecting that won't affect other connections? I also have other applications using the same MySQL server, some of which are designed specifically for MySQL, so they may escape backslashes in the MySQL way and switching the whole server to ANSI mode would break them.

I'm using MySQL 3.23 but I'm willing to upgrade to the latest 4.0x if it can solve this problem.


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to