Description:
When I multiply large decimal values, I eventually
get an incorrect result. It may be that I have hit
the maximum possible size of an operation; if
that is the case, MySQL should return an error
rather than an incorrect result.
How to repeat:
mysql> select 5000000000000000000000000000000000000 * -50000000000000000000000000.5;
+-----------------------------------------------------------------------+
| 5000000000000000000000000000000000000 * -50000000000000000000000000.5 |
+-----------------------------------------------------------------------+
| -250000000000000000000000002500000000000000000000000000000000000.0 |
+-----------------------------------------------------------------------+
1 row in set (0.00 sec)
-- This is the correct result.
mysql> select 5000000000000000000000000000000000000 * -500000000000000000000000000.5;
+------------------------------------------------------------------------+
| 5000000000000000000000000000000000000 * -500000000000000000000000000.5 |
+------------------------------------------------------------------------+
| -2500000000000000000000000000000000000000000000000000000000000000 |
+------------------------------------------------------------------------+
1 row in set (0.00 sec)
-- I add one more zero to the second operand and get the wrong
answer. MySQL should either return the correct answer or (if the
operation is too large) an error message saying that the requested
calculation cannot be performed.