Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.11
-
None
Description
partition_info::vers_set_hist_part() (sql/partition_info.cc) counts the history partitions to auto-create for INTERVAL ... AUTO and stops with
if (*create_count == MAX_PARTITIONS - 2) |
{
|
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(ME_WARNING));
|
my_error(ER_VERS_HIST_PART_FAILED, ...);
|
return true; |
}
|
The limit compares only the number of new partitions with MAX_PARTITIONS - 2. It ignores the partitions the table already has and the number of subpartitions, so the real total ((num_parts + create_count) * num_subparts) can be well over MAX_PARTITIONS while this check passes. The early error is then not given, and the limit is left to whatever checks the actual partition creation does.
MDEV-25529 adds vers_calc_hist_parts(), which sizes the layout at ALTER time with the correct limit ((n + 1) * num_subparts > MAX_PARTITIONS). The two should use one shared counting helper so that sizing at ALTER and auto-creation at DML agree.
Present in 10.11 and later (auto-create since 10.9).
Found during review of MDEV-25529 (https://github.com/MariaDB/server/pull/5294); the code predates that change.
Attachments
Issue Links
- relates to
-
MDEV-25529 Auto-create: Pre-existing historical data is not partitioned as specified by ALTER
-
- In Testing
-