summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_math.result
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2010-12-24 14:05:04 +0300
committerSergey Glukhov <sergey.glukhov@oracle.com>2010-12-24 14:05:04 +0300
commitbc56dcea9d7047c5561cee08ec2d74077e329f7d (patch)
tree14518ed65ff8a2be4328cc00d5eb9d6d347e8c37 /mysql-test/r/func_math.result
parent8bb96394865ded184fce6b9ba501bed2f7fb9ab5 (diff)
downloadmariadb-git-bc56dcea9d7047c5561cee08ec2d74077e329f7d.tar.gz
Bug#57810 case/when/then : Assertion failed: length || !scale
ASSERT happens due to improper calculation of the max_length in Item_func_div object, if dividend has max_length == 0 then Item_func_div::max_length is set to 0 under some circumstances. The fix: If decimals == NOT_FIXED_DEC then set Item_func_div::max_length to max possible DOUBLE length value. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: The fix: If decimals == NOT_FIXED_DEC then set Item_func_div::max_length to max possible DOUBLE length value.
Diffstat (limited to 'mysql-test/r/func_math.result')
-rw-r--r--mysql-test/r/func_math.result13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 649232e0b05..3a626084c9e 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -498,4 +498,17 @@ SELECT -9223372036854775808 MOD -1;
SELECT -9223372036854775808999 MOD -1;
-9223372036854775808999 MOD -1
0
+#
+# Bug#57810 case/when/then : Assertion failed: length || !scale
+#
+SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
+CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END
+NULL
+CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `C` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
End of 5.1 tests