[MCOL-3633] Incorrect results of bitwise operations performed on double data types. Created: 2019-11-28  Updated: 2023-10-25  Resolved: 2023-10-25

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

Type: Bug Priority: Minor
Reporter: Gagan Goel (Inactive) Assignee: Leonid Fedorov
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Bitwise operations on double data type in CS do not produce the same results as InnoDB.

Here is an example:

 
MariaDB [test]> create table c1 (a double)engine=columnstore;
Query OK, 0 rows affected (0.214 sec)
 
MariaDB [test]> insert into c1 values (1.797693227e108);
Query OK, 1 row affected (0.193 sec)
 
MariaDB [test]> select a, a & 0xff, a | 0xff, bit_count(a) from c1;
+-----------------+----------+---------------------+--------------+
| a               | a & 0xff | a | 0xff            | bit_count(a) |
+-----------------+----------+---------------------+--------------+
| 1.797693227e108 |        0 | 9223372036854776063 |            1 |
+-----------------+----------+---------------------+--------------+
1 row in set (0.101 sec)
 
MariaDB [test]> create table i1 as select * from c1;
Query OK, 1 row affected (0.071 sec)
Records: 1  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select a, a & 0xff, a | 0xff, bit_count(a) from i1;
+-----------------+----------+---------------------+--------------+
| a               | a & 0xff | a | 0xff            | bit_count(a) |
+-----------------+----------+---------------------+--------------+
| 1.797693227e108 |      255 | 9223372036854775807 |           63 |
+-----------------+----------+---------------------+--------------+
1 row in set, 3 warnings (0.001 sec)


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