List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 22 1999 8:33am
Subject:Re: insert \% bug
View as plain text  
On Wed, 1999-09-22 09:40:22 +0300, Heikki Suopanki wrote:
> Yes, I know \% is special in SELECTS, but the way it works with INSERT (or
> UPDATE) is not what I think it should be.
> If I do:
>  INSERT  INTO foo VALUES ('\a \+ \$ \# \%')
> the contents of that field becomes  a + $ # \%
> There is an extra \ before %
> I think that is a bug...?

Well, you could also argue that escaping characters which don't need
to be escaped is a bug (on client side) :)
What's about '\n' '\r' '\t'? These don't give you 'n' 'r' 't', either!
Backslash handling _is_ special, and '\%' giving you '\%' is one of
the special cases.

But I agree, that chapter "7.1.1 Strings" of the MySQL manual maybe
should be changed to make clear, that '\%' and '\_' don't give '%' and
'_', but '\%' and '\_'.

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
insert \% bugsuopanki21 Sep
  • insert \% bugMichael Widenius22 Sep
    • Re: insert \% bugHeikki Suopanki22 Sep
      • Re: insert \% bugMartin Ramsch22 Sep