mysql> update category set sequence=4 where company_id=94588133873178 and id=669302535743868015;
ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'B85F63B64E5930118D1C07993374BB60'
查看表结构后
CREATE TABLE `category` (
`id` varchar(50) NOT NULL,
`company_id` varchar(50) NOT NULL,
`created_by` varchar(50) DEFAULT NULL,
`created_time` datetime DEFAULT NULL,
`last_modified_by` varchar(50) DEFAULT NULL,
`last_modified_time` datetime DEFAULT NULL,
`name` varchar(50) NOT NULL,
`depth` int NOT NULL,
`type` varchar(10) NOT NULL,
`parent_id` varchar(50) DEFAULT NULL,
`level1_name` varchar(50) DEFAULT NULL,
`level2_name` varchar(50) DEFAULT NULL,
`level3_name` varchar(50) DEFAULT NULL,
`level4_name` varchar(50) DEFAULT NULL,
`sequence` int DEFAULT NULL COMMENT '排序',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3
因为公司id 以及 id 数据库中定义的是varchar 导致的问题.
加上引号就解决了.
update category set sequence=3 where company_id='94588133873178' and id='402498172257099776';