mysql - 插入行 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'
解决方案
推荐阅读
- vue.js - Vue 组件中 HTML 元素 id 的作用域
- swift - Swift (macOS):使用文件启动 TextEdit
- java - 如何从 Web 应用程序中预选特定打印机
- angular - shareReplay 更改顺序
- java - 如何将 Java 应用程序代码指标检测到 Prometheus
- r - 如何以编程方式向 R 中的交互式函数提供用户输入(特别是在总人口普查包中)
- html - html/css - 以可变数量的颜色拆分 td
- php - 如何使用 Endroid\QR Code 设置 QR 版本
- reactjs - 如何使用下拉列表中的选定选项创建新表?
- php - 如何使用 EOF、NUL、DLE 等 php 删除解密的 .eml 文件中的控制字符