[MCOL-4415] MOD returns a wrong result for DECIMAL arguments Created: 2020-11-27  Updated: 2023-07-02

Status: Open
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: 5.4.3, 5.5.1, 5.6.1, 6.1.1
Fix Version/s: Icebox

Type: Bug Priority: Minor
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: datatype


 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a DECIMAL(10,2)) ENGINE=ColumnStore;
INSERT INTO t1 VALUES (1.3);
SELECT a MOD 1.3 FROM t1;

+-----------+
| a MOD 1.3 |
+-----------+
|      0.30 |
+-----------+

If I run the same script with MyISAM (or any other engine), the result is as follows:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a DECIMAL(10,2)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1.3);
SELECT a MOD 1.3 FROM t1;

+-----------+
| a MOD 1.3 |
+-----------+
|      0.00 |
+-----------+


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