Consider the following table definition:
CREATE TABLE check_please (
c1 int constraint c1_not_42 check (c1 <> 42) default 42);
CHECK Constraints are a few years old in MySQL and are very useful. You set up a constraint and the MySQL server ensures that the data being inserted does not violate that constraint.
But what if the DEFAULT value violates that constraint? Which takes precedence - the default value of the constraint? We start with some direct action:
ERROR: 3819: Check constraint 'c1_not_42' is violated.