summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2006-10-11 14:55:23 +0400
committerunknown <kaa@polly.local>2006-10-11 14:55:23 +0400
commit0e371de9dd35eaf255747c646ab3bb4775fcb46a (patch)
tree7fc8120017f5a4f7a9cb2bd9d668b41ba1b8a8db /mysql-test/t/func_time.test
parentd7c7b25c7e9b758cdff733da11724bffe46573b3 (diff)
parentf29045b42b46347e709833cdd2be8c00e13eeceb (diff)
downloadmariadb-git-0e371de9dd35eaf255747c646ab3bb4775fcb46a.tar.gz
Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into polly.local:/home/kaa/src/maint/m41-maint--07OGk sql/field.cc: Auto merged sql/item_timefunc.cc: Auto merged mysql-test/r/func_time.result: Manually merged mysql-test/t/func_time.test: Manually merged
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 714379d0fb3..066a059483c 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -369,6 +369,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.
#