1734
MySQLERRORNotablePartitioningHIGH confidence
Partition name expected but subpartition name given
Production Risk
Low — DDL fails; no data affected.
What this means
A statement requiring a partition name received a subpartition name instead.
Why it happens
- 1Referencing a subpartition in a context that requires a partition name, such as ALTER TABLE ... TRUNCATE PARTITION.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t TRUNCATE PARTITION sp0; -- sp0 is a subpartition, not a partition
expected output
ERROR 1734 (HY000): Partition name expected; subpartition name found.
Fix
Use the correct partition name
Use the correct partition name
SHOW CREATE TABLE t; -- Use the partition name (e.g. p0) not the subpartition name (e.g. sp0). ALTER TABLE t TRUNCATE PARTITION p0;
Why this works
TRUNCATE PARTITION operates on top-level partitions; use the partition name shown by SHOW CREATE TABLE.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1734 ER_PARTITION_INSTEAD_OF_SUBPARTITION
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev