1935
MySQLERRORCommonDDLHIGH confidence

MAXVALUE cannot be used with LIST partitioning

Production Risk

None — DDL is rejected.

What this means

MAXVALUE is a special keyword for RANGE partitioning catch-all partitions; it cannot be used inside a VALUES IN (...) list for LIST partitioning.

Why it happens
  1. 1Using MAXVALUE inside a VALUES IN clause of a LIST partition definition.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (id INT) PARTITION BY LIST(id) (PARTITION p0 VALUES IN (MAXVALUE));

expected output

ERROR 1935 (HY000): MAXVALUE cannot be used with LIST partitioning.

Fix

Use MAXVALUE only in RANGE partitioning

Use MAXVALUE only in RANGE partitioning
-- For LIST, enumerate explicit values:
CREATE TABLE t (id INT) PARTITION BY LIST(id) (PARTITION p0 VALUES IN (1, 2, 3));

Why this works

MAXVALUE is only valid in RANGE partition definitions, not LIST.

Sources
Official documentation ↗

MySQL 8.0 — 1935 ER_MAXVALUE_IN_VALUES_IN2

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

← All MySQL errors