1971
MySQLERRORCommonDDLHIGH confidence
Column has duplicated value in SET/ENUM definition
Production Risk
None — DDL is rejected.
What this means
An ENUM or SET column definition lists the same value more than once. Each member value in ENUM and SET must be unique.
Why it happens
- 1ENUM('a', 'b', 'a') — 'a' appears twice.
- 2SET('read', 'write', 'read') — 'read' appears twice.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (status ENUM('active', 'inactive', 'active'));expected output
ERROR 1971 (HY000): Column 'status' has duplicated value 'active' in ENUM.
Fix
Remove duplicate values from the ENUM or SET definition
Remove duplicate values from the ENUM or SET definition
CREATE TABLE t (status ENUM('active', 'inactive', 'pending'));Why this works
Each value in an ENUM or SET must be unique.
Sources
Official documentation ↗
MySQL 8.0 — 1971 ER_DUPLICATED_VALUE_IN_TYPE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev