1369
MariaDBerrorqueryhigh confidence

CHECK OPTION failed on view

Production Risk

Low — DML fails; no data changed.

What this means

Similar to 1368; the WITH CHECK OPTION constraint on a view was violated by an INSERT or UPDATE.

Why it happens
  1. 1Same as ER_VIEW_NONUPD_CHECK; the SQLSTATE 44000 variant is raised in different execution paths
How to reproduce
trigger — this will error
trigger — this will error
UPDATE active_users SET active = 0 WHERE id = 1;

expected output

ERROR 1369 (44000): CHECK OPTION failed 'db.active_users'

Fix 1

Ensure the modified row satisfies the view WHERE

Why this works

The result of the DML must be visible through the view.

Fix 2

Modify the base table directly

Why this works

Bypasses the CHECK OPTION.

Sources
Official documentation ↗

MySQL 8.0 — 1369 ER_VIEW_CHECK_FAILED

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

← All MariaDB errors