1605
MariaDBERRORCommonPartitioningHIGH confidence

MAXVALUE cannot be used in VALUES IN

Production Risk

Low — the DDL fails; no table is created.

What this means

MAXVALUE is not valid in a LIST partition VALUES IN clause.

Why it happens
  1. 1Using MAXVALUE as a value in 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 (1, 2, MAXVALUE)
);

expected output

ERROR 1605 (HY000): Cannot use MAXVALUE as value in VALUES IN

Fix

Use explicit values only in LIST partitions

Use explicit values only in LIST partitions
CREATE TABLE t (id INT)
PARTITION BY LIST(id) (
  PARTITION p0 VALUES IN (1, 2, 3)
);

Why this works

LIST partitions require explicit values; MAXVALUE is only valid in RANGE partitions.

Sources
Official documentation ↗

MySQL 8.0 — 1605 ER_MAXVALUE_IN_VALUES_IN

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

← All MariaDB errors