Foreign keys / Transactions in MySQL.. WTF?

Andy Wardley abw at
Tue Jul 31 11:50:09 BST 2007

Dave Cross wrote:
> You can make MySQL work a lot more closely to how sane people expect 
> databases to work if you put the server into "strict mode".

   mysql> SET GLOBAL sql_mode="STRICT_ALL_TABLES";
   mysql> insert into badgers (name) VALUES ('tribble');
   ERROR 1364 (HY000): Field 'id' doesn't have a default value

Much better, thanks Dave.


More information about the mailing list