title: Can a MySQL trigger simulate a CHECK constraint?
body: <p>I want to use the CHECK constraint in MySQL, but it is not supported. (Unlike other RDBMS, it will understand but not enforce the CHECKs.)</p>
  
  <p>I have seen some workarounds with triggers. But they tend to set a default value to the field in question instead of returning an error.</p>
  
  <p>Is it possible to construct a trigger that returns an error if a condition is not met?</p>
  
  <p>Ultimately I want a trigger that copies a CHECK constraint.</p>