1518
MySQLERRORNotablePartitioningHIGH confidence

REORGANIZE PARTITION without parameters only valid on auto-partitioned HASH/KEY tables

Production Risk

Low — the ALTER TABLE fails; specify the target partitions.

What this means

ER_REORG_NO_PARAM_ERROR (1518, SQLSTATE HY000) is raised when REORGANIZE PARTITION is called without parameters on a table that is not an auto-partitioned HASH/KEY table.

Why it happens
  1. 1REORGANIZE PARTITION without specifying which partitions to reorganize on a RANGE/LIST table
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE range_t REORGANIZE PARTITION;
-- No partition list specified for RANGE table

expected output

ERROR 1518 (HY000): REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PF

Fix

Specify partition names for RANGE/LIST reorganization

Specify partition names for RANGE/LIST reorganization
ALTER TABLE range_t REORGANIZE PARTITION p0, p1 INTO (
  PARTITION pnew VALUES LESS THAN (500)
);

Why this works

RANGE/LIST reorganization requires explicit partition names to reorganize.

Sources
Official documentation ↗

MySQL 8.0 — 1518 ER_REORG_NO_PARAM_ERROR

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors