1324
MySQLerrorstored-procedureshigh confidence

Duplicate condition name

Production Risk

Low — compile-time error; routine not created.

What this means

Two DECLARE CONDITION statements in the same block use the same condition name.

Why it happens
  1. 1Copy-paste error when declaring multiple named conditions
How to reproduce
trigger — this will error
trigger — this will error
DECLARE my_cond CONDITION FOR SQLSTATE '45000'; DECLARE my_cond CONDITION FOR SQLSTATE '45001';

expected output

ERROR 1324 (42000): Duplicate condition: my_cond

Fix

Use unique condition names

Why this works

Each named condition must have a distinct name per block.

Sources
Official documentation ↗

MySQL 8.0 — 1324 ER_SP_DUP_COND

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

← All MySQL errors