Created
July 14, 2014 01:38
-
-
Save yoku0825/6a30f34695c8b4b81fbc 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> SELECT @@version; | |
+------------+ | |
| @@version | | |
+------------+ | |
| 5.6.19-log | | |
+------------+ | |
1 row in set (0.00 sec) | |
mysql56> SELECT @@sql_mode; | |
+------------+ | |
| @@sql_mode | | |
+------------+ | |
| | | |
+------------+ | |
1 row in set (0.00 sec) | |
mysql56> CREATE TABLE t1 (num int); | |
Query OK, 0 rows affected (0.04 sec) | |
mysql56> INSERT INTO t1 VALUES (''); | |
Query OK, 1 row affected, 1 warning (0.02 sec) | |
mysql56> SHOW WARNINGS; | |
+---------+------+-------------------------------------------------------+ | |
| Level | Code | Message | | |
+---------+------+-------------------------------------------------------+ | |
| Warning | 1366 | Incorrect integer value: '' for column 'num' at row 1 | | |
+---------+------+-------------------------------------------------------+ | |
1 row in set (0.00 sec) | |
mysql56> SET SESSION sql_mode= STRICT_TRANS_TABLES; | |
Query OK, 0 rows affected (0.00 sec) | |
mysql56> INSERT INTO t1 VALUES (''); | |
ERROR 1366 (HY000): Incorrect integer value: '' for column 'num' at row 1 | |
mysql56> SET SESSION sql_mode= ''; | |
Query OK, 0 rows affected (0.00 sec) | |
mysql56> INSERT INTO t1 VALUES (''); | |
Query OK, 1 row affected, 1 warning (0.00 sec) | |
mysql56> SHOW WARNINGS; | |
+---------+------+-------------------------------------------------------+ | |
| Level | Code | Message | | |
+---------+------+-------------------------------------------------------+ | |
| Warning | 1366 | Incorrect integer value: '' for column 'num' at row 1 | | |
+---------+------+-------------------------------------------------------+ | |
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment