Bug #29975 TIME_TO_SEC does never return more than 3020399 (838:59:59)
Submitted: 23 Jul 2007 9:51 Modified: 23 Jul 2007 10:52
Reporter: Sebastian Mendel (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0.37 OS:Linux (Fedora 7.9 (dev))
Assigned to: CPU Architecture:Any

[23 Jul 2007 9:51] Sebastian Mendel
Description:
i cannot work with TIME_TO_SEC() on TIME larger than 838:59:59 cause TIME_TO_SEC() does never return any value above 3020399

additional, there seems to be no GROUP BY aggregate function to work on TIME fields - so i am tied to the above construct, as i use it to SUM a TIME column:

   SELECT SUM(`my_time`)
     FROM `table`
 GROUP BY `id`

returns: 765

some completely wrong result, not formated in as TIME

   SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(`my_time`)))
     FROM `table`
 GROUP BY `id`

returns: 838:59:59

completely wrong too, at least formated as time ... ;-)

How to repeat:
should be differ:

SELECT TIME_TO_SEC('900:00:00');
SELECT TIME_TO_SEC('1000:00:00');
[23 Jul 2007 10:07] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read about renge of TIME values at http://dev.mysql.com/doc/refman/5.0/en/time.html
[23 Jul 2007 10:27] Sebastian Mendel
ok, sorry my fault

i thought this applies only to the column/field not to the TIME_TO_SEC() parameter

but how should somebody work with time values above 838?

and it should be mentioned in the TIME_TO_SEC() function description
[23 Jul 2007 10:39] Sveta Smirnova
> and it should be mentioned in the TIME_TO_SEC() function description

There is verified bug report about it: Bug #29381
[23 Jul 2007 10:52] Sebastian Mendel
so could or should i open a RFE for larger time values to be handled?