[MCOL-5307] select-union-select gives corrupted values Created: 2022-11-11  Updated: 2024-02-02

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

Type: Bug Priority: Critical
Reporter: Kirill Perov Assignee: Roman
Resolution: Unresolved Votes: 0
Labels: CS0702900
Environment:

mdb 10.11 branch bb-10.11-mdev-25080-fix1
columnstore branch columnstore-22.08.4-1



 Description   

DROP DATABASE IF EXISTS mcol641_union_db;

CREATE DATABASE mcol641_union_db;
USE mcol641_union_db;

SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

CREATE TABLE cs1 (d1 DECIMAL(38), d2 DECIMAL(38,10), d3 DECIMAL(38,38)) ENGINE=columnstore;
CREATE TABLE cs2 (d1 DECIMAL(38) UNSIGNED, d2 DECIMAL(38,10) UNSIGNED, d3 DECIMAL(38,38) UNSIGNED) ENGINE=columnstore;

INSERT INTO cs1 VALUES (125, 1.25, 0.125);
INSERT INTO cs1 VALUES (-125, -1.25, -0.125);
INSERT INTO cs1 values (99999999999999999999999999999999999998, 9999999999999999999999999999.9999999998, 0.99999999999999999999999999999999999998);
INSERT INTO cs1 values (99999999999999999999999999999999999999, 9999999999999999999999999999.9999999999, 0.99999999999999999999999999999999999999);
INSERT INTO cs1 values (-99999999999999999999999999999999999998, -9999999999999999999999999999.9999999998, -0.99999999999999999999999999999999999998);
INSERT INTO cs1 values (-99999999999999999999999999999999999999, -9999999999999999999999999999.9999999999, -0.99999999999999999999999999999999999999);

SELECT d1, d1, d2 FROM cs1 UNION SELECT d2, d3, d3 FROM cs1;

SHOULD GIVE

d1 d1 d2
125.0000000000 125.00000000000000000000000000000000000000 1.25000000000000000000000000000000000000
-125.0000000000 -125.00000000000000000000000000000000000000 -1.25000000000000000000000000000000000000
99999999999999999999999999999999999998.0000000000 999999999999999999999999999.99999999999999999999999999999999999999 999999999999999999999999999.99999999999999999999999999999999999999
99999999999999999999999999999999999999.0000000000 999999999999999999999999999.99999999999999999999999999999999999999 999999999999999999999999999.99999999999999999999999999999999999999
-99999999999999999999999999999999999998.0000000000 -999999999999999999999999999.99999999999999999999999999999999999999 -999999999999999999999999999.99999999999999999999999999999999999999
-99999999999999999999999999999999999999.0000000000 -999999999999999999999999999.99999999999999999999999999999999999999 -999999999999999999999999999.99999999999999999999999999999999999999
1.2500000000 0.12500000000000000000000000000000000000 0.12500000000000000000000000000000000000
-1.2500000000 -0.12500000000000000000000000000000000000 -0.12500000000000000000000000000000000000
9999999999999999999999999999.9999999998 0.99999999999999999999999999999999999998 0.99999999999999999999999999999999999998
9999999999999999999999999999.9999999999 0.99999999999999999999999999999999999999 0.99999999999999999999999999999999999999
-9999999999999999999999999999.9999999998 -0.99999999999999999999999999999999999998 -0.99999999999999999999999999999999999998
-9999999999999999999999999999.9999999999 -0.99999999999999999999999999999999999999 -0.99999999999999999999999999999999999999

BUT GIVES (~random incorrect values in columns)

----------------------------------------------------------------------------------------------------------------------------

d1 d1 d2

----------------------------------------------------------------------------------------------------------------------------

125.0000000000 -0.90447576074723148144860474975423823872 1.25000000000000000000000000000000000000
-125.0000000000 0.90447576074723148144860474975423823872 -1.25000000000000000000000000000000000000
1896011491092736564947192742.6130393088 -0.41211004042422656213785281988311121920 0.18924529734740337425340993422692974592
1896011491092736564947192743.6130393088 0.58788995957577343786214718011688878080 0.18924529744740337425340993422692974592
-1896011491092736564947192742.6130393088 0.41211004042422656213785281988311121920 -0.18924529734740337425340993422692974592
-1896011491092736564947192743.6130393088 -0.58788995957577343786214718011688878080 -0.18924529744740337425340993422692974592
1.2500000000 0.12500000000000000000000000000000000000 0.12500000000000000000000000000000000000
-1.2500000000 -0.12500000000000000000000000000000000000 -0.12500000000000000000000000000000000000
9999999999999999999999999999.9999999998 0.99999999999999999999999999999999999998 0.99999999999999999999999999999999999998
9999999999999999999999999999.9999999999 0.99999999999999999999999999999999999999 0.99999999999999999999999999999999999999
-9999999999999999999999999999.9999999998 -0.99999999999999999999999999999999999998 -0.99999999999999999999999999999999999998
-9999999999999999999999999999.9999999999 -0.99999999999999999999999999999999999999 -0.99999999999999999999999999999999999999

----------------------------------------------------------------------------------------------------------------------------

RUN WITHOUT COLUMNSTORE GIVES CORRECT RESULT:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

d1 d1 d2

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

125.0000000000 125.00000000000000000000000000000000000000 1.25000000000000000000000000000000000000
-125.0000000000 -125.00000000000000000000000000000000000000 -1.25000000000000000000000000000000000000
99999999999999999999999999999999999998.0000000000 999999999999999999999999999.99999999999999999999999999999999999999 999999999999999999999999999.99999999999999999999999999999999999999
99999999999999999999999999999999999999.0000000000 999999999999999999999999999.99999999999999999999999999999999999999 999999999999999999999999999.99999999999999999999999999999999999999
-99999999999999999999999999999999999998.0000000000 -999999999999999999999999999.99999999999999999999999999999999999999 -999999999999999999999999999.99999999999999999999999999999999999999
-99999999999999999999999999999999999999.0000000000 -999999999999999999999999999.99999999999999999999999999999999999999 -999999999999999999999999999.99999999999999999999999999999999999999
1.2500000000 0.12500000000000000000000000000000000000 0.12500000000000000000000000000000000000
-1.2500000000 -0.12500000000000000000000000000000000000 -0.12500000000000000000000000000000000000
9999999999999999999999999999.9999999998 0.99999999999999999999999999999999999998 0.99999999999999999999999999999999999998
9999999999999999999999999999.9999999999 0.99999999999999999999999999999999999999 0.99999999999999999999999999999999999999
-9999999999999999999999999999.9999999998 -0.99999999999999999999999999999999999998 -0.99999999999999999999999999999999999998
-9999999999999999999999999999.9999999999 -0.99999999999999999999999999999999999999 -0.99999999999999999999999999999999999999

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Single selects without union:
SELECT d1, d1, d2 FROM cs1;
SELECT d2, d3, d3 FROM cs1;
work fine.



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

kirill.perov@mariadb.com
is this a new issue or it happens in 64x

Comment by Kirill Perov [ 2022-11-12 ]

alexey.vorovich
it happened in Environment: mdb 10.11 branch bb-10.11-mdev-25080-fix1
columnstore branch columnstore-22.08.4-1

which used as droneCI build for mdb 10.11

drrtuy may have more details

Comment by Kirill Perov [ 2022-11-12 ]

alexey.vorovich
AFAIK issue is with mdb server 10.11 only (+columnstore)
so if 64x is tied to mdb 10.6 enterprise it will have no such issue
and if columnstore new release is tied to mdb 10.11 the issue will happen

columnstore new release doesn't have this issue with mdb 10.6, and 10.9

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