On Friday 28 February 2003 22:17, Brian Bittman wrote:

> Subject: bug - sec_to_time has a low upper limit on the range
>
> Description:
> sec_to_time will not return times greater than 24,
>  my hunch is that sec_to_time() is wrapping at 24:00 for some reason or
> that's some kind of bound, and it's not sticking to the TIME type which has
> a documented range of -838:.. to 838 hours.
>
> How-To-Repeat:
>     run this query:
> select
> sec_to_time(10.5*60*60),
> sec_to_time(18*60*60),
> sec_to_time(22*60*60),
> sec_to_time(23*60*60),
> sec_to_time(24*60*60),
> sec_to_time(24.5*60*60),
> sec_to_time(24.999*60*60),
> sec_to_time(26*60*60),
> sec_to_time(35*60*60),
> (35*60*60)/60/60
>
> you should see             10:30:00, 18:00:00, 22:00:00, 23:00:00,
> 23:00:00, 24:30:00, 24:59:56, 26:00:00, 35:00:00, 35
> but what you do get:     10:30:00, 18:00:00, 22:00:00, 23:00:00, 23:00:00,
> 23:30:00, 23:59:56, 23:00:00, 23:00:00, 35

I tested your example on 4.0.11 and got the following result:

mysql> select
    -> sec_to_time(10.5*60*60),
    -> sec_to_time(18*60*60),
    -> sec_to_time(22*60*60),
    -> sec_to_time(23*60*60),
    -> sec_to_time(24*60*60),
    -> sec_to_time(24.5*60*60),
    -> sec_to_time(24.999*60*60),
    -> sec_to_time(26*60*60),
    -> sec_to_time(35*60*60),
    -> (35*60*60)/60/60
    -> ;
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-------------------------+---------------------------+-----------------------+-----------------------+------------------+
| sec_to_time(10.5*60*60) | sec_to_time(18*60*60) | sec_to_time(22*60*60) | 
sec_to_time(23*60*60) | sec_to_time(24*60*60) | sec_to_time(24.5*60*60) | 
sec_to_time(24.999*60*60) | sec_to_time(26*60*60) | sec_to_time(35*60*60) | 
(35*60*60)/60/60 |
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-------------------------+---------------------------+-----------------------+-----------------------+------------------+
| 10:30:00                | 18:00:00              | 22:00:00              | 
23:00:00              | 24:00:00              | 24:30:00                | 
24:59:56                  | 26:00:00              | 35:00:00              |          
35.0000 |
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-------------------------+---------------------------+-----------------------+-----------------------+------------------+
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/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [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