1936
MySQLERRORNotableDDLHIGH confidence

Too many values specified for column list

Production Risk

Low — DDL is rejected.

What this means

A PARTITION BY RANGE COLUMNS or LIST COLUMNS definition provides more values in a VALUES LESS THAN or VALUES IN tuple than there are columns in the column list.

Why it happens
  1. 1Column list has 2 entries but a VALUES LESS THAN tuple provides 3 values.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (a INT, b INT) PARTITION BY RANGE COLUMNS(a, b) (PARTITION p0 VALUES LESS THAN (10, 20, 30));

expected output

ERROR 1936 (HY000): Too many values specified for column list.

Fix

Match the number of values to the number of columns in the COLUMNS list

Match the number of values to the number of columns in the COLUMNS list
CREATE TABLE t (a INT, b INT) PARTITION BY RANGE COLUMNS(a, b) (PARTITION p0 VALUES LESS THAN (10, 20));

Why this works

Each VALUES tuple must contain exactly as many elements as there are partitioning columns.

Sources
Official documentation ↗

MySQL 8.0 — 1936 ER_TOO_MANY_VALUES_ERROR2

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

← All MySQL errors