Corin Hartland-Swann wrote:


>   SELECT * FROM foo WHERE char_field = '96' AND int_field = 1;
> 
>   SELECT * FROM foo WHERE char_field = 96 AND int_field = 1;
> 
> Is it the expected behaviour for the second query to perform a numerical
> equivalence test on every row in the table in turn? It is returning rows
> with values like '096', '96foo' and the like.

MySQL does automatic type conversion when different types compared or 
assigned. As much I know String->Numeric is preferred there.

-- 
For technical support contracts, goto https://order.mysql.com/
    __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Tonu Samuel <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Security Administrator
/_/  /_/\_, /___/\___\_\___/   Hong Kong, China
        <___/   www.mysql.com


---------------------------------------------------------------------
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