summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-01-14 15:03:37 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2011-01-14 15:03:37 +0100
commit175e89260e8dfb00e7bc8c293253724407e293e1 (patch)
treefcfe8b1adf7da95ad34cbab733e7c40ed9133ac0 /mysql-test
parentad6c8d2342c791a9810fb0f98cc7ae17ef397458 (diff)
downloadmariadb-git-175e89260e8dfb00e7bc8c293253724407e293e1.tar.gz
Bug #59498 div function broken in mysql-trunk
mysql-test/r/func_math.result: New test case. mysql-test/t/func_math.test: New test case. sql/item_func.cc: Check for null before converting value to my_decimal.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_math.result6
-rw-r--r--mysql-test/t/func_math.test5
2 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index db4f6ddcf20..3149a2a3344 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -650,3 +650,9 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
NULL
Warnings:
Warning 1366 Incorrect decimal value: '' for column '' at row -1
+#
+# Bug #59498 div function broken in mysql-trunk
+#
+SELECT 1 div null;
+1 div null
+NULL
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index fe253617a27..e56b9c7d20d 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -495,3 +495,8 @@ DROP TABLE t1;
--echo # in do_div_mod with doubly assigned variables
--echo #
SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
+
+--echo #
+--echo # Bug #59498 div function broken in mysql-trunk
+--echo #
+SELECT 1 div null;