On Mon, 29 Oct 2001, Jindo Soul wrote:

> Why this error exists is beyond my knowledge though.
> I am guessing that Perl DBI escapes ' \ in bind_param call.
> And MySQL escapes the data again when using big5 charset,
> which ultimate causes an error because of double escaping.

Well, its not that MySQL does any escaping but you're basically right.

The DBD::mysql driver will escape all instances of the backslash.  If the
backslash is the last character in a string _and_ the last part of the
string represents a multibyte big5 character, there's a problem.

Perl turns 'A\' into 'A\\'.  But MySQL will see that as 'A\' plus '\''.
In other words, the second backslash is seen as escaping the single quote,
leaving the quote not terminated.

I tried patching the DBD::mysql code a year or so back but my C skills are
very weak and I couldn't quite get it.  I still have the patches somewhere
if someone more skilled than me wants to take a crack at it.  Basically,
I was looking to add a 'mysql_wide_charset' option that could be passed to
the driver.  Nowadays, it might be better if instead it just checked with
the server as soon as it connects (though that only works for newer
MySQLs).


-dave

/*==================
www.urth.org
We await the New Sun
==================*/



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to