mysql 5.6中关于strict_trans_tables的讨论 在mysqlteam的成员morgan tocker的博文http://www.tocker.ca/2014/01/14/making-strict-sql_mode-the-default.html中,提到了mysql 5.6中默认用的是严格模式了,就是在my.cnf中 sql_mode=no_engine_substitution,st
mysql 5.6中关于strict_trans_tables的讨论在mysqlteam的成员morgan tocker的博文http://www.tocker.ca/2014/01/14/making-strict-sql_mode-the-default.html中,提到了mysql 5.6中默认用的是严格模式了,就是在my.cnf中
sql_mode=no_engine_substitution,strict_trans_tables
其中:
strict_all_tables - behave more like the sql standard and produce errors when data is out of range.
strict_trans_tables - behave more like the sql standard and produce errors when data is out of range, but only on transactional storage engines like innodb.
由于mysql 5.6默认用innodb ,所以用strict_trans_tables也容易理解。用了这个选项的话,
那么数据库中如果是非空值的话就得设置默认值了,否则是报错的
此外,在http://www.tocker.ca/2013/11/01/proposal-to-simplify-sql-modes.html中还提到要去掉多余的sql_mode,比如:
error_for_division_by_zero, no_zero_date and no_zero_in_date.
不过这好像还在讨论阶段
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!