Stephen Clouse wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Mon, Apr 04, 2005 at 03:41:56PM +0100, Steve Hay wrote:
>  
>
>>Binding parameters: UPDATE foo SET str = 'one', num = 1.#INF WHERE 
>>id = 1
>>    
>>
>
>You're being bitten by two things:
>
>1. MySQL doesn't actually support placeholders; DBD::mysql emulates them by 
>   interpolating the value into the SQL directly.
>
>2. MySQL allows # as an alternative to the ANSI --, to start a comment that 
>goes 
>   to end-of-line.
>
>Knowing those two things, I think you can figure out why your SQL is giving 
>such 
>bizarre results.
>
I hadn't realised either of those two facts, but guessed that # must be 
interpreted by MySQL as a comment-introducer.

I still think that it could have done better, though.  If the "1.#INF" 
had been quoted in the SQL statement that was generated then it would 
have worked fine, and I think that it should have been quoted since 
DBI::looks_like_number() returns false for the string "1.#INF".

- Steve


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender 
immediately.  The unauthorized use, disclosure, copying or alteration of this 
message is strictly forbidden.  Note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of Radan Computational Ltd.  The recipient(s) of this message should 
check it and any attached files for viruses: Radan Computational will accept no 
liability for any damage caused by any virus transmitted by this email.

Reply via email to