0

Having error on NodeJs after successfully insert query executed.

The confusing thing is data inserted in the Table successfully and not getting an error inside the callback function db.query(insertMsgQuery, (err, rows, fields) => { console.log('query error === ', err) }); but due to error shown below my Node APP crashed [nodemon] app crashed - waiting for file changes before starting...

Insert Query

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')

Error

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

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

Schema enter image description here

Ankur
  • 102
  • 6
  • Can you add the schema for `chat_thread_messages`? Are your values all cast properly and do you have any constraints in place? – dusthaines Apr 21 '20 at 17:38
  • I just updated my question with schema image see. Thanks – Ankur Apr 22 '20 at 05:24
  • Does this answer your question? [Error Code 1292 - Truncated incorrect DOUBLE value - Mysql](https://stackoverflow.com/questions/16068993/error-code-1292-truncated-incorrect-double-value-mysql) – Xaqron Apr 22 '20 at 05:33

0 Answers0