Created
November 18, 2014 07:40
-
-
Save yoku0825/160ec19790721956320b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysql56> SET sql_mode= ''; | |
| Query OK, 0 rows affected (0.00 sec) | |
| mysql56> INSERT INTO t1 VALUES ('2012-02-30'); | |
| Query OK, 1 row affected, 1 warning (0.00 sec) | |
| mysql56> SHOW WARNINGS; | |
| +---------+------+---------------------------------------------+ | |
| | Level | Code | Message | | |
| +---------+------+---------------------------------------------+ | |
| | Warning | 1264 | Out of range value for column 'dt' at row 1 | | |
| +---------+------+---------------------------------------------+ | |
| 1 row in set (0.01 sec) | |
| mysql56> | |
| mysql56> SET sql_mode= 'STRICT_TRANS_TABLES'; | |
| Query OK, 0 rows affected (0.00 sec) | |
| mysql56> | |
| mysql56> INSERT INTO t1 VALUES ('2012-02-30'); | |
| ERROR 1292 (22007): Incorrect datetime value: '2012-02-30' for column 'dt' at row 1 | |
| mysql56> SET sql_mode= CONCAT_WS(',', @@sql_mode, 'ALLOW_INVALID_DATES'); | |
| Query OK, 0 rows affected (0.00 sec) | |
| mysql56> | |
| mysql56> SELECT @@sql_mode; | |
| +-----------------------------------------+ | |
| | @@sql_mode | | |
| +-----------------------------------------+ | |
| | STRICT_TRANS_TABLES,ALLOW_INVALID_DATES | | |
| +-----------------------------------------+ | |
| 1 row in set (0.00 sec) | |
| mysql56> | |
| mysql56> INSERT INTO t1 VALUES ('2012-02-30'); | |
| Query OK, 1 row affected (0.01 sec) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment