[MDEV-25540] Auto-create: There is no clear way to disable auto-creation without ruining existing partitions Created: 2021-04-27  Updated: 2022-01-12  Resolved: 2022-01-12

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Versioned Tables
Affects Version/s: 10.8
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Aleksey Midenkov
Resolution: Duplicate Votes: 0
Labels: duplicate

Issue Links:
Duplicate
duplicates MDEV-27328 Change of SYSTEM_TIME partitioning op... Closed
Relates
relates to MDEV-17554 Auto-create history partitions for sy... Closed

 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).


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