summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
diff options
context:
space:
mode:
authoranozdrin/alik@alik. <>2006-11-07 13:45:56 +0300
committeranozdrin/alik@alik. <>2006-11-07 13:45:56 +0300
commit7cf65fd3090d3b6e5696ef92eb5615de20041001 (patch)
tree42fb1db881900588ca6d4b0cce2a7d825736863a /mysql-test/t/func_time.test
parentbfbf1cdee9ceb32a87f361a90e803dec2f3f6d61 (diff)
parent56f10ac81a9eefe03a1c0e0bbb25d928c64db6b3 (diff)
downloadmariadb-git-7cf65fd3090d3b6e5696ef92eb5615de20041001.tar.gz
Merge alik.:/mnt/raid/alik/MySQL/devel/5.0-rt
into alik.:/mnt/raid/alik/MySQL/devel/5.0-merged-5.0-rt
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r--mysql-test/t/func_time.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 500eb8ac9c7..a3985998b13 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -487,6 +487,47 @@ show create table t1;
drop table t1;
#
+# Bug #11655: Wrong time is returning from nested selects - maximum time exists
+#
+# check if SEC_TO_TIME() handles out-of-range values correctly
+SELECT SEC_TO_TIME(3300000);
+SELECT SEC_TO_TIME(3300000)+0;
+SELECT SEC_TO_TIME(3600 * 4294967296);
+
+# check if TIME_TO_SEC() handles out-of-range values correctly
+SELECT TIME_TO_SEC('916:40:00');
+
+# check if ADDTIME() handles out-of-range values correctly
+SELECT ADDTIME('500:00:00', '416:40:00');
+SELECT ADDTIME('916:40:00', '416:40:00');
+
+# check if SUBTIME() handles out-of-range values correctly
+SELECT SUBTIME('916:40:00', '416:40:00');
+SELECT SUBTIME('-916:40:00', '416:40:00');
+
+# check if MAKETIME() handles out-of-range values correctly
+SELECT MAKETIME(916,0,0);
+SELECT MAKETIME(4294967296, 0, 0);
+SELECT MAKETIME(-4294967296, 0, 0);
+SELECT MAKETIME(0, 4294967296, 0);
+SELECT MAKETIME(0, 0, 4294967296);
+SELECT MAKETIME(CAST(-1 AS UNSIGNED), 0, 0);
+
+# check if EXTRACT() handles out-of-range values correctly
+SELECT EXTRACT(HOUR FROM '100000:02:03');
+
+# check if we get proper warnings if both input string truncation
+# and out-of-range value occur
+CREATE TABLE t1(f1 TIME);
+INSERT INTO t1 VALUES('916:00:00 a');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Bug #20927: sec_to_time treats big unsigned as signed
+#
+# check if SEC_TO_TIME() handles BIGINT UNSIGNED values correctly
+SELECT SEC_TO_TIME(CAST(-1 AS UNSIGNED));
# 21913: DATE_FORMAT() Crashes mysql server if I use it through
# mysql-connector-j driver.
#