summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_set.test
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-11-23 16:30:06 +0400
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-11-23 16:30:06 +0400
commit1f57bfb8d1ed7f4cbe4a3410752903106cc8d34c (patch)
tree63d16cb4ade1aaafefad3d67afb0b06bf25bf078 /mysql-test/t/func_set.test
parent3f43b07b4ae78728c9bc6e608eb66ba2c35ce9a8 (diff)
downloadmariadb-git-1f57bfb8d1ed7f4cbe4a3410752903106cc8d34c.tar.gz
Fix for bug #32560: crash with interval function and count(*)
Problem: INTERVAL function implementation doesn't handle NULL range values. Fix: skip NULL ranges looking for a proper one. mysql-test/r/func_set.result: Fix for bug #32560: crash with interval function and count(*) - test result. mysql-test/t/func_set.test: Fix for bug #32560: crash with interval function and count(*) - test case. sql/item_cmpfunc.cc: Fix for bug #32560: crash with interval function and count(*) - skip NULL ranges calculating INTERVAL(...).
Diffstat (limited to 'mysql-test/t/func_set.test')
-rw-r--r--mysql-test/t/func_set.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test
index 710b9b90a05..e4fde6e0e0e 100644
--- a/mysql-test/t/func_set.test
+++ b/mysql-test/t/func_set.test
@@ -54,4 +54,21 @@ select find_in_set(binary 'a', 'A,B,C');
#
select find_in_set('1','3,1,');
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug #32560: crash with interval function and count(*)
+#
+SELECT INTERVAL(0.0, NULL);
+SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL));
+SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL));
+SELECT INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+ CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL),
+ CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL));
+SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL),
+ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL));
+
+--echo End of 5.0 tests