1
0
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:
Sergey Glukhov
2010-12-24 14:05:04 +03:00
parent 8b0f0a9723
commit b69b46c775
3 changed files with 29 additions and 2 deletions

View File

@ -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