[MCOL-4121] Bitwise operations on DECIMAL(38) column do not match results of InnoDB. Created: 2020-06-28  Updated: 2020-12-22  Resolved: 2020-12-22

Status: Closed
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Gagan Goel (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-4460 Bit functions must behave as with oth... Closed
relates to MCOL-641 Full DECIMAL support in ColumnStore Closed

 Description   

Results of some bitwise operations do not match InnoDB. It appears that for some values, ColumnStore is producing correct results while for others, output of InnoDB looks correct.

Here is the relevant SQL from decimal/dql/functions.sql:

DROP TABLE IF EXISTS cs1;
CREATE TABLE cs1 (d1 DECIMAL(38), d2 DECIMAL(38)) ENGINE=columnstore;
INSERT INTO cs1 VALUES (123, 234), (999999999999999999999999999999, -999999999999999999999999999999), (999999999999999999, -999999999999999999), (1329227995784915872903807060280344576, 1), (-1329227995784915872903807060280344576, 1);
SELECT "bitwise_and_test", d1 & d2, d1 & d1, d2 & d2, d1 & 10, d2 & 10 FROM cs1;
SELECT "bitwise_or_test", d1 | d2, d1 | d1, d2 | d2, d1 | 10, d2 | 10 FROM cs1;
SELECT "bitwise_xor_test", d1 ^ d2, d1 ^ d1, d2 ^ d2, d1 ^ 10, d2 ^ 10 FROM cs1 WHERE d1 != 999999999999999999;
SELECT "bitwise_leftshift_test", d1 << 1, d1 << 10, d1 << 20, d2 << 1, d2 << 10, d2 << 20 FROM cs1 WHERE d1 <= 999999999999999999;
SELECT "bitwise_rightshift_test", d1 >> 1, d1 >> 10, d1 >> 20, d2 >> 1, d2 >> 10, d2 >> 20 FROM cs1;
SELECT "bitcount_test", bit_count(d1), bit_count(d2) FROM cs1;



 Comments   
Comment by Gagan Goel (Inactive) [ 2020-06-28 ]

For now, we are changing the results of the ref file to match output from ColumnStore. This issue is a placeholder to revert back the ref file once the results of these operations are consistent

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