[MDEV-23953] Decimal precision Created: 2020-10-13  Updated: 2020-10-27  Resolved: 2020-10-13

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.4.15
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Vadim Sirbu Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

docker node:12-alpine


Attachments: Text File variables.txt    
Issue Links:
Duplicate
is duplicated by MDEV-23702 calculating(auto rounding) issue Closed

 Description   

I have the following query "SELECT 6/101*100"

In mariadb-10.4.13 it returns "5.9406"
In mariadb-10.4.15 it returns "5.9400"

Attached the output of "SHOW VARIABLES"



 Comments   
Comment by Alice Sherepa [ 2020-10-13 ]

Thanks! MDEV-23702 was reported for the same bug, If you'd like to follow the progress, please, watch task MDEV-23702.
As a temporary workaround, one could change div_precision_increment:

MariaDB [(none)]> SELECT 6/101*100;
+-----------+
| 6/101*100 |
+-----------+
|    5.9400 |
+-----------+
1 row in set (0.001 sec)
 
MariaDB [(none)]> set div_precision_increment=8;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> SELECT 6/101*100;
+------------+
| 6/101*100  |
+------------+
| 5.94059400 |
+------------+
1 row in set (0.000 sec)

Generated at Thu Feb 08 09:26:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.