SQLite Forum

CHECK violation during table definition ignored, normal or bug?
Login
> returning just the table name is rather redundant as an INSERT or UPDATE can only work on a single table, so there is no ambiguity

Unless triggers are involved, in which case the table with a failing `CHECK` clause may _not_ be the one mentioned in the `INSERT` or `UPDATE` command:

```sqlite
sqlite> create table x (a check ( a < 10 ) ) ;
sqlite> create table y (b check ( b < 20 ) ) ;
sqlite> create trigger yx after insert on y begin insert into x values ( new.b ) ; end ;
sqlite> insert into y values ( 24 ) ;
Error: CHECK constraint failed: y
sqlite> insert into y values ( 14 ) ;
Error: CHECK constraint failed: x
```