[MDEV-6852] Sequence of decimal division and multiplications returns 0 instead of the real result Created: 2014-10-08  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.40
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-6841 test decimal math Open

 Description   

MariaDB [test]> SELECT 621215273600417790 / 6 * 10000000000000000000.0 * 0.0000000001;
+----------------------------------------------------------------+
| 621215273600417790 / 6 * 10000000000000000000.0 * 0.0000000001 |
+----------------------------------------------------------------+
|                                              0.000000000000000 |
+----------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL also returns 0.
PostgreSQL produces the result:

SELECT 621215273600417790 / 6 * 10000000000000000000.0 * 0.0000000001;
                ?column?                 
-----------------------------------------
 103535878933402965000000000.00000000000


Generated at Thu Feb 08 07:15:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.