sequelize upgrade issue from v4.42.0/v4.44.4 to v5.22.3 (using mysql2 v1.6.5/v1.6.6)

108 views
Skip to first unread message

Venkata Siva Naga Tatikonda

unread,
Jul 1, 2020, 5:45:01 PM7/1/20
to node-mysql
Hello Team,

We are trying to upgrade sequelize from v4.42.0/v4.44.4 to v5.22.3 and are using mysql2 v1.6.5/v1.6.6

Basically we are trying to insert a record into the mysql database and thats when we received the above error in upgraded version. However, we are seeing below error:

"SequelizeDatabaseError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[object Object]' at line 2\n    
    at Query.formatError (/opt/app/node_modules/sequelize/lib/dialects/mysql/query.js:244:16)\n    
    at Query.handler [as onResult] (/opt/app/node_modules/sequelize/lib/dialects/mysql/query.js:51:23)\n    
    at Query.execute (/opt/app/node_modules/mysql2/lib/commands/command.js:30:14)\n    
    at Connection.handlePacket (/opt/app/node_modules/mysql2/lib/connection.js:408:32)\n    
    at PacketParser.onPacket (/opt/app/node_modules/mysql2/lib/connection.js:70:12)\n    
    at PacketParser.executeStart (/opt/app/node_modules/mysql2/lib/packet_parser.js:75:16)\n    
    at TLSSocket.<anonymous> (/opt/app/node_modules/mysql2/lib/connection.js:328:25)\n    
    at TLSSocket.emit (events.js:310:20)\n    
    at TLSSocket.EventEmitter.emit (domain.js:482:12)\n    
    at addChunk (_stream_readable.js:286:12)\n    
    at readableAddChunk (_stream_readable.js:268:9)\n    
    at TLSSocket.Readable.push (_stream_readable.js:209:10)\n    
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)",

"message": "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[object Object]' at line 2"

We have enabled to log all function call parameters for troubleshooting and please find attached logs with details. Could someone please help me understand the issue here or any pointers/support would be appreciated as well ?

Thanks in advance for the help.

Regards,
Pavan.
sequelize-v4.44.4-v4.42.0_and_mysql2-v1.6.5-v1.6.6.log
sequelize-v5.22.3_mysql2-v1.6.5_and_v1.6.6.log

Ryan Lee

unread,
Jul 1, 2020, 6:48:40 PM7/1/20
to node-...@googlegroups.com
Can you post the code that calls this query?

Check the values you are passing to the query. My best guess is one of the parameters is an object when it shouldn't be.

--Ryan

--
You received this message because you are subscribed to the Google Groups "node-mysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-mysql+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/node-mysql/19a11ce4-2c2e-4833-a5b4-047158d877d4o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages