Mysql 1292截断了不正确的整数值
我没有看到什么?我不知道我为什么会犯这个错误。它甚至不应该要求整数Mysql 1292截断了不正确的整数值,mysql,sql,integer,mariadb,mysql-error-1292,Mysql,Sql,Integer,Mariadb,Mysql Error 1292,我没有看到什么?我不知道我为什么会犯这个错误。它甚至不应该要求整数 MariaDB [ams]> describe server_current_status; +----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------
MariaDB [ams]> describe server_current_status;
+----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| serverid | varchar(20) | YES | | NULL | |
| status | varchar(20) | YES | | NULL | |
| notify | varchar(15) | YES | | NULL | |
| totime | varchar(20) | YES | | NULL | |
| fromtime | varchar(20) | YES | | NULL | |
+----------+-------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)
MariaDB [ams]> UPDATE server_current_status SET notify = 'SOME' AND status = 'DOWN' WHERE serverid = '8';
Query OK, 0 rows affected, 2 warnings (0.04 sec)
Rows matched: 1 Changed: 0 Warnings: 2
MariaDB [ams]> show warnings;
+---------+------+-------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: 'SOME' |
| Warning | 1292 | Truncated incorrect DOUBLE value: 'SOME' |
+---------+------+-------------------------------------------+
2 rows in set (0.00 sec)
这是一个布尔表达式。引擎的读数是这样的
notify = ('SOME' AND (status = 'DOWN'))
因此,引擎尝试将'SOME'
转换为布尔值(在MySQL/MariaDB中为0
或1
)
你可能想要这个:
notify = 'SOME', status = 'DOWN'
我明白了。忘了逗号。应该有逗号的地方有一个“AND”
notify = 'SOME', status = 'DOWN'