From 52c044008508b1b445b21d780a238c9cb0b8c891 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Dec 2005 18:48:08 +0300 Subject: Fixed BUG #12440: "Incorrect processing of time values containing long fraction and/or large exponent part". mysql-test/r/type_time.result: Fixed testcases results (bug #12440) mysql-test/t/type_time.test: Added testcases for bug #12440 sql-common/my_time.c: Fixed bug #12440: "Incorrect processing of time values containing long fraction and/or large exponent part". Modified str_to_time(). Process properly fraction part containing more than 6 digits. Check for existence of exponent part which may result from %g formatting applied to time value specified as large real number. --- mysql-test/r/type_time.result | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 025cf2a57f1..cb76f699cd9 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -85,3 +85,27 @@ sec_to_time(time_to_sec(t)) 13:00:00 09:00:00 drop table t1; +SELECT CAST(235959.123456 AS TIME); +CAST(235959.123456 AS TIME) +23:59:59.123456 +SELECT CAST(0.235959123456e+6 AS TIME); +CAST(0.235959123456e+6 AS TIME) +23:59:59.123456 +SELECT CAST(235959123456e-6 AS TIME); +CAST(235959123456e-6 AS TIME) +23:59:59.123456 +SELECT CAST(235959.1234567 AS TIME); +CAST(235959.1234567 AS TIME) +23:59:59.123456 +Warnings: +Warning 1292 Truncated incorrect time value: '235959.1234567' +SELECT CAST(0.2359591234567e6 AS TIME); +CAST(0.2359591234567e6 AS TIME) +23:59:59.123456 +Warnings: +Warning 1292 Truncated incorrect time value: '235959.1234567' +SELECT CAST(0.2359591234567e+30 AS TIME); +CAST(0.2359591234567e+30 AS TIME) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '2.359591234567e+29' -- cgit v1.2.1