summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <aivanov@mysql.com>2005-12-15 18:59:40 +0300
committerunknown <aivanov@mysql.com>2005-12-15 18:59:40 +0300
commit4db14a57e758bbc8662cddd5a85edbf30f16d634 (patch)
tree76aaa9b0c93271d0dad0165fa08b22b0f1720249 /mysql-test
parent4e971ef7a6ee5de5a2a709a5eb316717e8473219 (diff)
parent52c044008508b1b445b21d780a238c9cb0b8c891 (diff)
downloadmariadb-git-4db14a57e758bbc8662cddd5a85edbf30f16d634.tar.gz
Merge mysql.com:/home/alexi/dev/mysql-4.1-12440
into mysql.com:/home/alexi/dev/mysql-5.0-12440 mysql-test/r/type_time.result: Auto merged ndb/src/ndbapi/NdbImpl.hpp: Auto merged ndb/src/ndbapi/NdbRecAttr.cpp: Auto merged ndb/src/ndbapi/ndb_cluster_connection.cpp: Auto merged sql-common/my_time.c: Auto merged zlib/Makefile.am: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_time.result24
-rw-r--r--mysql-test/t/type_time.test14
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index 442435b0459..deb60a95f21 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'
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index 7ae3f65f7cc..9abfe914335 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -21,4 +21,18 @@ select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1;
select sec_to_time(time_to_sec(t)) from t1;
drop table t1;
+#
+# BUG #12440: Incorrect processing of time values containing
+# long fraction part and/or large exponent part.
+#
+# These must return normal result:
+SELECT CAST(235959.123456 AS TIME);
+SELECT CAST(0.235959123456e+6 AS TIME);
+SELECT CAST(235959123456e-6 AS TIME);
+# These must cut fraction part and produce warning:
+SELECT CAST(235959.1234567 AS TIME);
+SELECT CAST(0.2359591234567e6 AS TIME);
+# This must return NULL and produce warning:
+SELECT CAST(0.2359591234567e+30 AS TIME);
+
# End of 4.1 tests