[MCOL-5258] MariaDB 10.5 Columnstore: multiplying decimals yields wrong result Created: 2022-10-12  Updated: 2023-06-12

Status: Open
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 5.5.2
Fix Version/s: Icebox

Type: Bug Priority: Critical
Reporter: andreas eschbacher Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Server version: 10.5.10-MariaDB MariaDB Server
CS 5.5.2


Attachments: File EBI-724_bug_exposal.sql    

 Description   

MariaDB Columnstore cannot multiply decimals correctly when precision/number of digits increases some values. (MariaDB Version 10.5., EBI04).

See the bug exposal file attached.
InnoDB computes the correct values.

(This was found when trying to test the YF cube based upon a DB-view for EBI-721 by multiplying the X/Y coos.)



 Comments   
Comment by alexey vorovich (Inactive) [ 2022-10-12 ]

Hm.. I rerun this with 22.08. aeae81 could u please rerun this with 220802
dleeyh fyi.

ariaDB [d1]> 
MariaDB [d1]> insert into decimal_test_CS values (2, 11.42, 48.76);
Query OK, 1 row affected (0.362 sec)
 
MariaDB [d1]> insert into decimal_test_InnoDB values (2, 11.42, 48.76);
Query OK, 1 row affected (0.003 sec)
 
MariaDB [d1]> 
MariaDB [d1]> select val1*val2 from decimal_test_CS; -- 3.4368777 ==> WRONG
+------------------------+
| val1*val2              |
+------------------------+
| 556.839200000000000000 |
+------------------------+
1 row in set (0.142 sec)
 
MariaDB [d1]> select val1*val2 from decimal_test_InnoDB; -- 556.8392 ==> CORRECT
+------------------------+
| val1*val2              |
+------------------------+
| 556.839200000000000000 |
+------------------------+
1 row in set (0.001 sec)

Comment by andreas eschbacher [ 2022-10-13 ]

@alexey.vorovich@mariadb.com
seems to be a bug in 10.5.
Can't recreate the error on our 10.6.9 Server (Columnstore_version | 6.4.3 )

Comment by Allen Herrera [ 2023-06-12 ]

Large decimal support has been improved in newer versions

MariaDB [test]> insert into decimal_test_CS values (2, 11.42, 48.76);
Query OK, 1 row affected (0.129 sec)
 
MariaDB [test]> select val1*val2 from decimal_test_CS;
+------------------------+
| val1*val2              |
+------------------------+
| 556.839200000000000000 |
+------------------------+
1 row in set (0.052 sec)
 
MariaDB [(none)]> select calgetversion();
+-----------------+
| calgetversion() |
+-----------------+
| 23.02.3         |
+-----------------+

Generated at Thu Feb 08 02:56:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.