mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -315,4 +315,13 @@ SELECT -9223372036854775808 DIV -1;
|
||||
SELECT -9223372036854775808 MOD -1;
|
||||
SELECT -9223372036854775808999 MOD -1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#57810 case/when/then : Assertion failed: length || !scale
|
||||
--echo #
|
||||
|
||||
SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
|
||||
CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user