Bug #76580 Decimal multiplication loses precision for no good reason
Submitted: 2 Apr 2015 17:19 Modified: 3 Apr 2015 11:46
Reporter: Elena Stepanova Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:5.1, 5.5, 5.6, 5.7 OS:Any
Assigned to: CPU Architecture:Any

[2 Apr 2015 17:19] Elena Stepanova
Description:
MySQL [test]> select 0.00000000000000000000000001035 * 100000000000000000000000000000000000000000000;
+---------------------------------------------------------------------------------+
| 0.00000000000000000000000001035 * 100000000000000000000000000000000000000000000 |
+---------------------------------------------------------------------------------+
|                               1000000000000000000.00000000000000000000000000000 |
+---------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Both values are within DECIMAL range, so there should be no loss. 

How to repeat:
select 0.00000000000000000000000001035 * 100000000000000000000000000000000000000000000;
[3 Apr 2015 11:46] MySQL Verification Team
Hello Elena,
 
Thank you for the report and test case.
Confirmed similar results on 5.1.73, 5.5.42, 5.6.25 and 5.7.8.

Thanks,
Umesh