3610
MariaDBWARNINGCriticalQueryHIGH confidence

Constant value in conditional expression

Production Risk

Low — Warning only; query executes but may scan more rows than intended.

How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM t WHERE 1 = 1 AND status = 'active';

expected output

Warning 3610: Constant expression in conditional detected.

Fix

Replace constant with a meaningful condition

Replace constant with a meaningful condition
SELECT * FROM t WHERE status = 'active';

Why this works

Removes the trivially true constant that adds no filtering logic.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 3610 ER_WARN_CONSTANT_IN_CONDITIONAL_EXPRESSION

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

← All MariaDB errors