[MCOL-4407] Query with impossible filters against larger tables returns wrong result. Created: 2020-11-20  Updated: 2021-09-21  Resolved: 2021-06-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.7, 1.2, 1.4, 5.4.3
Fix Version/s: 6.1.1

Type: Bug Priority: Blocker
Reporter: Richard Stracke Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 1
Labels: None

Sprint: 2021-8, 2021-9

 Description   

To reproduce:

set columnstore_select_handler=on;
 
DROP TABLE IF EXISTS `sictable`;
 
CREATE TABLE IF NOT EXISTS  `sictable` 
  ( 
     `serialno`    VARCHAR(20)    NOT NULL 
  ) 
    ENGINE=Columnstore
    DEFAULT CHARSET=utf8
  ; 
  
INSERT INTO `sictable`  (
with recursive series as (
select 1 as id union all
select id +1 as id from series
where id < 6281)
select lpad(id,11,'0') from series);
 
SELECT  `serialno`  
FROM  `sictable`  
WHERE  `serialno` = '00000000029'   AND  `serialno` = '00000006256'   ; 

The last select returns 2 rows, but expect would be 0.

If change the part

where id < 6281

to

where id < 6280

The select returns in this case as expected no rows.

Trace for working version

Desc Mode Table               TableOID ReferencedColumns PIO LIO PBE Elapsed Rows 
DSS  PM   sictable2           3120     (serialno)        0   10  -   0.000   1    
DSS  PM   sictable2           3120     (serialno)        0   10  -   0.000   1    
BPS  PM   sictable2           3120     (serialno)        8   25  0   0.007   0    
HJS  PM   sictable2-sictable2 3120     -                 -   -   -   -----   -    
HJS  PM   sictable2-sictable2 3120     -                 -   -   -   -----   -    
TNS  UM   -                   -        -                 -   -   -   0.000   0   

For non working >= 6281

Desc Mode Table     TableOID ReferencedColumns PIO LIO PBE Elapsed Rows 
BPS  PM   sictable2 3123     (serialno)        19  28  0   0.023   2    
TNS  UM   -         -        -                 -   -   -   0.000   2 

The issue occured only with columnstore_select_handler = on (vtable accordingly for older versions)



 Comments   
Comment by Daniel Lee (Inactive) [ 2021-06-25 ]

Build verified: 6.1.1 ( drone #2640 )

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