1285
MariaDBerrorddlhigh confidence

Value list not allowed for this partition type

Production Risk

Low — DDL fails; no data affected.

What this means

A VALUES LESS THAN or VALUES IN clause was used with a partition type that does not support it (e.g. HASH or KEY partitioning).

Why it happens
  1. 1Specifying VALUES LESS THAN on a HASH-partitioned table
  2. 2Using a RANGE-style clause on a LIST partition incorrectly
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (id INT) PARTITION BY HASH(id) (PARTITION p0 VALUES LESS THAN (10));

expected output

ERROR 1285 (HY000): It is not allowed to specify value_list for this type of partitioning

Fix

Remove the VALUES clause for HASH/KEY

Remove the VALUES clause for HASH/KEY
CREATE TABLE t (id INT) PARTITION BY HASH(id) PARTITIONS 4;

Why this works

HASH and KEY partitioning determine partition assignment automatically.

Sources
Official documentation ↗

MySQL 8.0 — 1285 ER_PARTITION_WRONG_VALUES_ERROR

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

← All MariaDB errors