1521
MariaDBERRORNotablePartitioningHIGH confidence
At least one partition must be added
Production Risk
Low — the ALTER TABLE fails; add a valid partition definition.
What this means
ER_ADD_PARTITION_NO_NEW_PARTITION (1521, SQLSTATE HY000) is raised when ALTER TABLE ADD PARTITION is executed without specifying any partition definitions.
Why it happens
- 1ADD PARTITION clause is empty or has no valid partition definitions
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t ADD PARTITION (); -- Empty partition list
expected output
ERROR 1521 (HY000): At least one partition must be added
Fix
Specify at least one partition definition
Specify at least one partition definition
ALTER TABLE t ADD PARTITION ( PARTITION p_new VALUES LESS THAN (2025) ); -- For HASH/KEY, use: ALTER TABLE t ADD PARTITION PARTITIONS 2;
Why this works
ADD PARTITION requires at least one valid partition definition.
Sources
Official documentation ↗
MySQL 8.0 — 1521 ER_ADD_PARTITION_NO_NEW_PARTITION
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev