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

Auto-create: There is no clear way to disable auto-creation without ruining existing partitions

    XMLWordPrintable

Details

    Description

      Note: If there is in fact a way to disable auto-partitioning, please make it a documentation request, as at the very least it is not obvious.

      I have an auto-partitioned table with some already existing and populated history partitions:

      bb-10.6-midenok-MDEV-17554 b96b96f9f3ec

      create or replace table t1 (pk int primary key, a int) engine=MyISAM with system versioning partition by system_time limit 100 auto;
      insert into t1 select seq, seq from seq_1_to_80;
      replace into t1 select seq, seq from seq_1_to_80;
      replace into t1 select seq, seq from seq_1_to_80;
      replace into t1 select seq, seq from seq_1_to_80;
      replace into t1 select seq, seq from seq_1_to_80;
      replace into t1 select seq, seq from seq_1_to_80;
      select partition_name, table_rows from information_schema.partitions where table_name = 't1';
      +----------------+------------+
      | partition_name | table_rows |
      +----------------+------------+
      | p0             |        160 |
      | p1             |        160 |
      | p2             |         80 |
      | pn             |         80 |
      +----------------+------------+
      

      Now I just want to disable further auto-partitioning.
      What I tried was:

      alter table t1 partition by system_time limit 100;
      

      but it reorganizes existing partitions into 1+1:

      MariaDB [test]> select partition_name, table_rows from information_schema.partitions where table_name = 't1';
      +----------------+------------+
      | partition_name | table_rows |
      +----------------+------------+
      | p0             |        400 |
      | pn             |         80 |
      +----------------+------------+
      2 rows in set (0.003 sec)
      

      or (back from the original structure with 3+1 partitions):

      alter table t1 partition by system_time limit 100 partitions 4;
      

      but it still reorganizes partitions and puts everything into the first one:

      MariaDB [test]> select partition_name, table_rows from information_schema.partitions where table_name = 't1';
      +----------------+------------+
      | partition_name | table_rows |
      +----------------+------------+
      | p0             |        400 |
      | p1             |          0 |
      | p2             |          0 |
      | pn             |         80 |
      +----------------+------------+
      

      (maybe tried something else, but to no avail).

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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