A CHECK CONSTRAINT
only applies to the table it is defined on, and only guarantees integrity if the constraint is derived from the row it is applied to.
This is also documented in the Interbase 6.0 Data Definition Guide on page 106 (available from the reference manual section of the Firebird site):
Note A
CHECK
constraint guarantees data integrity only when the values being verified are in the same row that is being inserted and deleted. If you try to compare values in different rows of the same table or in different tables, another user could later modify those values, thus invalidating the original CHECK constraint that was applied at insertion time.
So if you modify table_b
in such a way that the check contraint applied to table_a
no longer holds, then you will not receive an error because this constraint does not apply to this table.
Now if you modify table_a
, the check constraint will fire and will result in an error (only for modified row(s), and only where the constraint no longer holds).