MySQL 5 “strict " mode applies when either
STRICT_ALL_TABLES is included in the list of
options supplied to the
STRICT_ALL_TABLES will cause any attempt to
set a column to an invalid value to fail with an error.
STRICT_TRANS_TABLES has the same effect, but
only if the table is transactional.
If neither of these settings is in effect, MySQL will either accept the update or do a “best fit” of the invalid value into a legal column value. For instance, if you try to assign a string value into an integer column, MySQL may set the value of the column to 0. A warning will be generated whenever such a “truncation” occurs.
Strict mode will also cause errors to occur for missing columns
INSERT statement, unless that
column has an associated
STRICT_ALL_TABLES can have
some dubious side effects when you are performing multirow updates or
inserts into nontransactional tables. Because there is no rollback
capability for a nontransactional table, the error may occur after a
certain number of valid row updates have occurred. This means that in
the event of a strict-mode error on a nontransactional table, the SQL
statement may partially succeed. This is rarely desirable behavior,
and for this reason the default setting in MySQL 5.0 is
You can change your strict mode at any time with a
The strict mode also determines how stored programs ...