[MCOL-3823] CLONE - Wrong min/max after cpimport which causes wrong select results Created: 2020-02-20  Updated: 2020-08-25  Resolved: 2020-03-16

Status: Closed
Project: MariaDB ColumnStore
Component/s: cpimport
Affects Version/s: 1.2.5
Fix Version/s: 1.2.6

Type: Bug Priority: Major
Reporter: Patrick LeBlanc (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: bulk


 Description   

If min/max is set cpimport not delete min/max like another write statement and
not updates min/max.

This cause wrong select results , because extent elimination wrongly exclude extents.

Create 2 Files

1 File c1.txt with content

"2019-12"

1 File c2.txt with content

"2020-01"

Execute:

use test;
create table c1 (pf char(7)) engine = columnstore;

Now load file c1.

/usr/local/mariadb/columnstore/bin/cpimport test c1 c1.txt -E \" -C "\\"
/usr/local/mariadb/columnstore/bin/cpimport test c1 c2.txt -E \" -C "\\"

MariaDB [test]> select * from pixid.c1 where pf = "2020-01";
Empty set (0.107 sec)
 
MariaDB [test]> select * from pixid.c1;
+---------+
| pf      |
+---------+
| 2019-12 |
| 2020-01 |
+---------+
2 rows in set (0.037 sec)

Delete and reimport via cpimport will fix it.

delete from pixid.c1 where pf = "2020-01";

/usr/local/mariadb/columnstore/bin/cpimport test c1 c2.txt -E \" -C "\\"

MariaDB [(none)]> use test;
Database changed
MariaDB [test]> select * from c1 where pf = "2020-01";
+---------+
| pf      |
+---------+
| 2020-01 |
+---------+
1 row in set (0.106 sec)

If you do the same with a select after the delete, the reimport will fail.

MariaDB [test]> select * from c1 where pf = "2020-01";
+---------+
| pf      |
+---------+
| 2020-01 |
+---------+
1 row in set (0.106 sec)
 
MariaDB [test]> delete from c1 where pf = "2020-01";
Query OK, 1 row affected (0.437 sec)

reimport with cpimport file c2.txt as above and:

MariaDB [(none)]> use test;
Database changed
MariaDB [test]>  select * from c1 where pf = "2020-01";
Empty set (0.079 sec)
 
MariaDB [test]> select calShowPartitions('c1','pf');
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| calShowPartitions('c1','pf')                                                                                                                                 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Part#     Min                           Max                           Status
  0.0.2     2019-12                       2019-12                       Enabled |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.002 sec)



 Comments   
Comment by Daniel Lee (Inactive) [ 2020-03-16 ]

Build verified: 1.2.6-1 source
server
commit d3294cf9c18663673c62532dddaa11369ba184d0
engine
commit 668b23a23c59f6ba4f3aa00b6aa768f5931d59fb

Please refer to MCOL-3716

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