From 175e89260e8dfb00e7bc8c293253724407e293e1 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 14 Jan 2011 15:03:37 +0100 Subject: 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. --- mysql-test/r/func_math.result | 6 ++++++ mysql-test/t/func_math.test | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') 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; -- cgit v1.2.1