|
|
|
|
|
by ars
5069 days ago
|
|
It's not silent: mysql> insert into demo values ('y', 'y');
Query OK, 1 row affected, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------+
| Warning | 1366 | Incorrect integer value: 'y' for column 'n' at row 1 |
+---------+------+------------------------------------------------------+
If you want this type of warning to be treated as an error then adjust the setting: mysql> SET sql_mode = 'TRADITIONAL';
mysql> insert into demo values ('y', 'y');
ERROR 1366 (HY000): Incorrect integer value: 'y' for column 'n' at row 1
|
|