MySQL2 Connection Pool Connections with Incorrect Result Despite client.config Being Correct #3587
Unanswered
anjani-pandey
asked this question in
Q&A
Replies: 1 comment
-
follow up |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue:
When creating multiple pools/connections to the same host with different configs (e.g., different typeCast values), query execute with previous connection's settings, even though client.config shows the correct values.
Reproduction:
js
// Pool A - typeCast: false
const poolA = createPool({ host: 'db1', typeCast: true });
// Pool B - typeCast: true
const poolB = createPool({ host: 'db1', typeCast: false });
// Pool B queries incorrectly use typeCast: false as result is not buffer data
Expected Behavior:
Each connection should strictly adhere to its own configuration.
Questions:
Environment:
MySQL2 v3.14.1, Node.js v22.11.0, MySQL v3.14.1
**NOTE: Is this MYSQL Server specific behavior, not terminating the connection created and being reused internally instead of creating a fresh pool connection for new connection configuration? **
Beta Was this translation helpful? Give feedback.
All reactions