3609
MariaDBWARNINGCriticalDDLHIGH confidence

Redundant constraint ignored

Production Risk

Low — Warning only; the DDL operation succeeds.

How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (id INT NOT NULL PRIMARY KEY);

expected output

Warning 3609: Redundant constraint 'NOT NULL' ignored.

Fix

Simplify column definition

Simplify column definition
CREATE TABLE t (id INT PRIMARY KEY);

Why this works

PRIMARY KEY already implies NOT NULL; explicit NOT NULL is redundant.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 3609 ER_WARN_REDUNDANT_CONSTRAINT

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

← All MariaDB errors