summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
diff options
context:
space:
mode:
authorunknown <mhansson/martin@linux-st28.site>2007-10-09 14:58:09 +0200
committerunknown <mhansson/martin@linux-st28.site>2007-10-09 14:58:09 +0200
commitae4141ed75124cc4bbae5fa22662ef0e7f00b122 (patch)
tree8bf99e9f04ece5292c895e49ede9a191d11c5610 /mysql-test/t/func_time.test
parent692b686dae872c4d93f472d11d16eb8807076f98 (diff)
downloadmariadb-git-ae4141ed75124cc4bbae5fa22662ef0e7f00b122.tar.gz
Bug#31160: MAKETIME() crashes server when returning NULL in ORDER BY using filesort
Even though it returns NULL, the MAKETIME function did not have this property set, causing a failed assertion (designed to catch exactly this). Fixed by setting the nullability property of MAKETIME(). mysql-test/r/func_sapdb.result: Bug#31160: Changed test result. mysql-test/r/func_time.result: Bug#31160: Test result. mysql-test/t/func_time.test: Bug#31160: Test case. sql/item_timefunc.h: Bug#31160: The fix: Initializing maybe_null to true
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r--mysql-test/t/func_time.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 86c848983fa..c0a449ac3f4 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -545,6 +545,16 @@ DROP TABLE testBug8868;
SET NAMES DEFAULT;
+#
+# Bug #31160: MAKETIME() crashes server when returning NULL in ORDER BY using
+# filesort
+#
+CREATE TABLE t1 (
+ a TIMESTAMP
+);
+INSERT INTO t1 VALUES (now()), (now());
+SELECT 1 FROM t1 ORDER BY MAKETIME(1, 1, a);
+DROP TABLE t1;
#
# Bug #19844 time_format in Union truncates values