Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pool.query(undefined) doesn't release connection #163

Closed
Drejerdk opened this issue Jun 21, 2021 · 2 comments
Closed

Pool.query(undefined) doesn't release connection #163

Drejerdk opened this issue Jun 21, 2021 · 2 comments

Comments

@Drejerdk
Copy link

Drejerdk commented Jun 21, 2021

If pool.query is called without a valid SQL parameter, the connection will never get realsed.

It took me quite a while to figure out that I was missing a comma between the array parameter and the query in the line below, which caused my code to leak connections.
pool.query(`SELECT COUNT(*) FROM tx.tx_push_messages WHERE id= ? AND msgType= "stop-reminder";`[id])

Is this a bug, or is there some reason the processTaskPromise and processTaskCallback only calls conn.releaseWithoutError(); if the SQL parameter is set?

@rusher
Copy link
Collaborator

rusher commented Jun 21, 2021

Even if query is expect to be defined, driver has to handle those cases.
I've created https://jira.mariadb.org/browse/CONJS-170 to handle that

rusher pushed a commit that referenced this issue Sep 15, 2021
…ion #163

pool wasn't releasing connection
An error must be thrown immediately, and never stall a connection
@rusher
Copy link
Collaborator

rusher commented Sep 15, 2021

done. Correction will be available in 2.5.5, 3.0.1-RC

@rusher rusher closed this as completed Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants