Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28338

Auto-create: doesn't work for engine=MyRocks with LIMIT

    XMLWordPrintable

Details

    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;
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.