首页 > 解决方案 > 插入行 ER_TRUNCATED_WRONG_VALUE 出错:截断不正确的 DOUBLE 值:'null'

问题描述

成功执行插入查询后,NodeJs 上出现错误。

令人困惑的是数据成功插入表中,并且在回调函数中没有出错,db.query(insertMsgQuery, (err, rows, fields) => { console.log('query error === ', err) });但是由于下面显示的错误,我的 Node APP 崩溃了[nodemon] app crashed - waiting for file changes before starting...

插入查询

INSERT INTO `chat_thread_messages` (`thread_id`,`msg_text`,`from`,`to`,`product_id`,`msg_type`) VALUES (9,'Bonjour, Cet article est-il toujours disponible?',6,7,4,'text')

错误

node_modules/mysql/lib/protocol/Parser.js:437
      throw err; // Rethrow non-MySQL errors
      ^

Error: ER_TRUNCATED_WRONG_VALUE: Truncated incorrect DOUBLE value: 'null'

架构 在此处输入图像描述

标签: mysqlnode.js

解决方案


推荐阅读