1602
MariaDBERRORNotablePartitioningHIGH confidence

Partition column list error

Production Risk

Low — the DDL fails; no table is created.

What this means

An error in the column list specification for a COLUMNS partitioning definition.

Why it happens
  1. 1Using a duplicate column in the COLUMNS list.
  2. 2Specifying zero columns in a COLUMNS partition.
  3. 3Using a column type not supported for COLUMNS partitioning.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (a INT, b INT)
PARTITION BY RANGE COLUMNS(a, a) -- duplicate column
(PARTITION p0 VALUES LESS THAN (10, 10));

expected output

ERROR 1602 (HY000): Same partition column appears more than once in the partitioning clause

Fix

Use each column only once in the COLUMNS list

Use each column only once in the COLUMNS list
CREATE TABLE t (a INT, b INT)
PARTITION BY RANGE COLUMNS(a, b)
(PARTITION p0 VALUES LESS THAN (10, 10));

Why this works

Each column in a COLUMNS partition definition must appear exactly once.

Sources
Official documentation ↗

MySQL 8.0 — 1602 ER_PARTITION_COLUMN_LIST_ERROR

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

← All MariaDB errors