Sugar 5.1 supports “strict mode” in MySQL
Thursday, July 31st, 2008Strict mode is a mode where at least one of STRICT_TRANS_TABLES or STRICT_ALL_TABLES is enabled.
Enabling strict mode can increase data integrity. How? In a nutshell, when strict mode validates inputed and reports errors for invalid data and does not allow the invalid data to be written to the database.
Examples of invalid data that can be handled by strict mode:
1) If you try to insert a 50-character value into 40-character field, in non-strict mode the excess characters will be truncated and the insert will succeed. With strict mode, MySQL returns an error and the insert fails.
2) The date field in mysql is internally stored as a string, which means that invalid dates can be inserted in non-strict mode, and you will see errors only when you try to render the data. With strict mode, again, MySQL returns an error and the insert fails.
The above are examples for just two data types. There are may be several other conditions associated with each data type.
For more detailed and technical information about enabling strict mode in MySQL, read the page on SQL Modes in the MySQL website.