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

mssqlnative query are not correctly closed #590

Closed
laurent-n opened this issue Jan 8, 2020 · 2 comments
Closed

mssqlnative query are not correctly closed #590

laurent-n opened this issue Jan 8, 2020 · 2 comments
Labels
bug mssqlnative Native driver for SQL Server driver (Tier 1)
Milestone

Comments

@laurent-n
Copy link
Contributor

In drivers/adodb-mssqlnative.inc.php
method _close() contains a bug causing this method do nothing
if(is_object($this->_queryID)) {
is wrong because $this->_queryID is not an object but a resource (probable copy/paste from PDO version)
it should be
if(is_resource($this->_queryID)) {
It cause extra cursor left open, and if there's multiple big query on the same DB blocs through a getrow it can cause a deadlock, it's not common on normal operation but I've spend hours on a such bug due to a bugged query. Could be an issue on long worker too.

@mnewnham
Copy link
Contributor

mnewnham commented Jan 9, 2020

I apologize. I thought that there was a different issue to what we have originally discussed. I have pushed a fix directly into master and 5.20 for the next hotfix. if there are no other issues, please close this.

@laurent-n
Copy link
Contributor Author

Thanks

@dregad dregad added bug mssqlnative Native driver for SQL Server driver (Tier 1) labels Jan 12, 2020
@dregad dregad added this to the v5.20.16 milestone Jan 12, 2020
mnewnham added a commit that referenced this issue Jan 27, 2020
Fix #590 closes the connection early, making affected_rows() fail. In addition, the value returned for an invalid query (-1) does not conform to the ADOdb standard (false). Affected Rows is now retrieved immediately after query execution and stored for later use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mssqlnative Native driver for SQL Server driver (Tier 1)
Projects
None yet
Development

No branches or pull requests

3 participants