andrew,
Monday, October 21, 2002, 8:53:15 PM, you wrote:

aatdc> Description:
aatdc>          When attempting to select rows periodically (as in scheduling) the
aatdc>          INTERVAL function will round the parts of an expression before doing
aatdc>          the calculation of the expression.  For example:

aatdc>             now() - INTERVAL 0.1*60 MINUTE == now()

aatdc>          The correct result would be a difference of six minutes!  While
aatdc>          this can be corrected if manually entering values, if the 0.1 in
aatdc>          the above example comes from a table column you cannot.  Yes, the
aatdc>          system could have been designed to operate in non-fractional minutes
aatdc>          but hours were more convenient.

aatdc> How-To-Repeat:
aatdc>          select now(), now() - interval (0.1*60) minute;
aatdc> Fix:
aatdc>          Perhaps change the order of operations within the INTERVAL processing
aatdc>          so that a fractional formula is calculated BEFORE rounding the values
aatdc>          in the formula.

I tested your example on 4.0.4 and it works well:

mysql> select now(), now()- interval (0.1*60) minute;
+---------------------+---------------------------------+
| now()               | now()- interval (0.1*60) minute |
+---------------------+---------------------------------+
| 2002-10-22 14:25:08 | 2002-10-22 14:19:08             |
+---------------------+---------------------------------+
1 row in set (0.00 sec)


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   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