[EMAIL PROTECTED] wrote on 12.07.2002 12:58:00:

>
>MySQL,
>
>I'd have expected all three of the following to give the same result,
>but even if there's a type-conversion  problem from INT, then I
>certainly wouldn't expect it to be different for 798.1 and 1e30 for
>example...
>
>mysql> select 798 between 75.2 and 999.1;
>+----------------------------+
>| 798 between 75.2 and 999.1 |
>+----------------------------+
>|                          1 |
>+----------------------------+
>1 row in set (0.01 sec)
>
>mysql> select 798 between 75.2 and 1e30;
>+---------------------------+
>| 798 between 75.2 and 1e30 |
>+---------------------------+
>|                         0 |    <<<-------- Really?
>+---------------------------+
>1 row in set (0.00 sec)
>
>mysql> select 798.1 between 75.2 and 1e30;
>+-----------------------------+
>| 798.1 between 75.2 and 1e30 |
>+-----------------------------+
>|                           1 |
>+-----------------------------+
>1 row in set (0.00 sec)
>
>
>Any comments?
>

Hi James,

tested this against 3.23.45; it's reproducible. The problem appears if the 
upper range exceeds 0.92233e19 (signed bigint). But the manual states that this 
is NOT a bug: 

expr BETWEEN min AND max
  ...
  - If expr is an integer expression, an integer comparision is done.
  - Otherwise, a floating-point (real) comparision is done.
  ...

Bye Oliver
--
Good programming is 40% experience, 30% skill, 20% RTFM, 10% caffeine, and 5% 
attention to detail. 

Oliver Six, CEO
CAHOS GmbH, Cimbernstr. 51, Germany 81377 Muenchen
Phone +49 89 71 01 93 41,  Fax +49 89 71 01 93 42


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