当前使用版本(必填,否则不予处理)
3.5.3.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
调用自动生成的mapper的updateById时报错(xxx为datetime类型字段):
com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: '1689669639805' for column "xxx"
如果直接调用mapper的insert方法;一切正常;
重现步骤(如果有就写完整)
报错信息
Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: '1689669639805' for column 'xxxxx' at row 1
; Data truncation: Incorrect datetime value: '1689669639805' for column 'xxxx' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: '1689669639805' for column 'xxxxx' at row 1
Comment From: dpzain
debug发现 insert时typeHandler是正常的;而update时,typehandler全部失效,变成了java.lang.Object;如下图对比
Comment From: dpzain
已解决;时全局自定义handler导致的