Current Behavior
node-red-node-mysql returns parsed JSON instead of string when column contains JSON-formatted text
I noticed this issue after rebuilding my Node-RED Docker container. My application had been working correctly, but after recreating the container and reinstalling dependencies, the node-red-node-mysql node started returning different data for the same query, despite using the same version of the Node-RED MySQL node.
Specifically, when a database column contains JSON data stored as a string, the node now returns a parsed JavaScript object instead of the original string value. This broke parts of my existing flow that expected the column value to remain a string.
The behavior appears to be related to a change in the mysql2 dependency. While investigating, I found that mysql2 introduced a breaking change regarding JSON handling, apparently: jsonStrings: true config option should be active
Related issue:
sidorares/node-mysql2#4402
Expected Behavior
node-red-node-mysql returns data from a column/table with no parsing
Steps To Reproduce
Perform a Select of a column that contains a stringified json
Environment
- Node-RED version: 5.5.0
- Node.js version: 24
Current Behavior
node-red-node-mysql returns parsed JSON instead of string when column contains JSON-formatted text
I noticed this issue after rebuilding my Node-RED Docker container. My application had been working correctly, but after recreating the container and reinstalling dependencies, the node-red-node-mysql node started returning different data for the same query, despite using the same version of the Node-RED MySQL node.
Specifically, when a database column contains JSON data stored as a string, the node now returns a parsed JavaScript object instead of the original string value. This broke parts of my existing flow that expected the column value to remain a string.
The behavior appears to be related to a change in the mysql2 dependency. While investigating, I found that mysql2 introduced a breaking change regarding JSON handling, apparently: jsonStrings: true config option should be active
Related issue:
sidorares/node-mysql2#4402
Expected Behavior
node-red-node-mysql returns data from a column/table with no parsing
Steps To Reproduce
Perform a Select of a column that contains a stringified json
Environment