[MDEV-28338] Auto-create: doesn't work for engine=MyRocks with LIMIT Created: 2022-04-18  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Partitioning, Versioned Tables
Affects Version/s: 10.9
Fix Version/s: 10.11

Type: Bug Priority: Minor
Reporter: Lena Startseva Assignee: Aleksey Midenkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17554 Auto-create history partitions for sy... Closed

 Description   

Test:

-- source include/have_partition.inc
-- source include/have_sequence.inc
-- source include/have_rocksdb.inc
 
 
create table t1 (x int) engine=rocksdb  with system versioning
partition by system_time limit 10 auto;
 
insert into t1 select seq from seq_1_to_100;
 
delete from t1 where x<10;
select count(*) from t1 partition (p0);
update  t1 set x=10 where x<25;
select count(*) from t1 partition (p0);
delete from t1;
select count(*) from t1 partition (p0);
 
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
 
drop table t1;

Expected result: (according MDEV-28337)

create table t1 (x int) engine=rocksdb  with system versioning
partition by system_time limit 10 auto;
insert into t1 select seq from seq_1_to_100;
delete from t1 where x<10;
select count(*) from t1 partition (p0);
count(*)
9
update  t1 set x=10 where x<25;
select count(*) from t1 partition (p0);
count(*)
24
delete from t1;
select count(*) from t1 partition (p0);
count(*)
24
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
partition_name	table_rows
p0	24
p1	91
pn	0
drop table t1;

Actual result:
All history is stored in partition p0 and the statistics are incorrect.

create table t1 (x int) engine=rocksdb  with system versioning
partition by system_time limit 10 auto;
insert into t1 select seq from seq_1_to_100;
delete from t1 where x<10;
select count(*) from t1 partition (p0);
count(*)
9
update  t1 set x=10 where x<25;
select count(*) from t1 partition (p0);
count(*)
24
delete from t1;
select count(*) from t1 partition (p0);
count(*)
115
select partition_name, table_rows from information_schema.partitions where table_name = 't1';
partition_name	table_rows
p0	0
pn	0
drop table t1;


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