Bug #10571 If value is added to 'SEC_TO_TIME(seconds)', does not return proper result.
Submitted: 12 May 2005 7:36 Modified: 13 May 2005 8:14
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.5-beta pre-release OS:Windows (Windows Server 2003)
Assigned to: CPU Architecture:Any

[12 May 2005 7:36] Disha
Description:
If value is added to function 'SEC_TO_TIME(seconds)', does not return proper result.

How to repeat:
1. delimiter //
2. create database test//
3. use test
4. set @@sql_mode='traditional'//
5. select sec_to_time(120)+90//
6. Execution of step (5) returns wrong result as,
	+---------------------+
	| sec_to_time(120)+90 |
	+---------------------+
	|                 290 |
	+---------------------+

Expected Results: The function 'SEC_TO_TIME(seconds)' should return proper result.

Actual Results  : The execution displays the result as,

	+---------------------+
	| sec_to_time(120)+90 |
	+---------------------+
	|                 290 |
	+---------------------+
[13 May 2005 8:14] Hartmut Holzgraefe
When used in a numeric context datetime values are converted to integers of the form YYYYMMDDhhmmss. 120 sec. expand to 00000000000200 this way, or 200 if you drop the
leading zeros. Adding 90 to this results in 290 -> expected result
[13 May 2005 9:26] Disha
Please reflect the appropriate explaination in Manual when we add the value to the returned value of SEC_TO_TIME(seconds) function.