1937
MariaDBERRORNotableDDLHIGH confidence
Partition row expression can only contain a single column value
Production Risk
Low — DDL is rejected.
What this means
A partition expression in non-COLUMNS partitioning returns or references multiple column values, which is not allowed; only a single scalar expression is permitted.
Why it happens
- 1Using a tuple or ROW constructor in a non-COLUMNS PARTITION BY expression.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (a INT, b INT) PARTITION BY RANGE((a, b)) (PARTITION p0 VALUES LESS THAN (10, 20));
expected output
ERROR 1937 (HY000): Row expression in partitioning expression only allowed for list and range.
Fix
Use RANGE COLUMNS for multi-column partitioning
Use RANGE COLUMNS for multi-column partitioning
CREATE TABLE t (a INT, b INT) PARTITION BY RANGE COLUMNS(a, b) (PARTITION p0 VALUES LESS THAN (10, 20));
Why this works
Multi-column partition bounds require RANGE COLUMNS or LIST COLUMNS syntax.
Sources
Official documentation ↗
MySQL 8.0 — 1937 ER_ROW_SINGLE_PARTITION_FIELD_ERROR2
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev