News for hackers. Stuff that matters.
Re:Five Common Rails Mistakes by mzarate06 on Sunday May 06, 2012 @03:06PM (#3935972)
MySQL will silently truncate it without throwing an error however.

It will indeed, for folks that prefer that or haven't looked into enabling alternate behavior. Set STRICT_TRANS_TABLES (for InnoDB) or STRICT_ALL_TABLES (for any storage engine) in MySQL's config and it'll throw the following error instead of silently truncating data:

[Err] 1406 - Data too long for column '[some column]' at row [XYZ]

Does that help?

There are no comments on this comment yet.