node-red / node-red/node-red-nodes

Breaking changes in node-red-node-mysql dependency

Open
#1,142 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
13h 57m
Merged PRs (30d)
3

Description

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:
https://github.com/sidorares/node-mysql2/issues/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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a SELECT against a column containing stringified JSON in node-red-node-mysql with the reported Node-RED and Node.js versions. Then inspect the node-red-node-mysql package and its mysql2 dependency configuration; done means the column is returned as its original string without changing other query results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mysql, node.js
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.