Skip to content

pdo_dblib closes connection when cursor closes - #319

Closed
capile wants to merge 2 commits into
php:masterfrom
capile:issue-64522
Closed

capile wants to merge 2 commits into
php:masterfrom
capile:issue-64522

Conversation

@capile

@capile capile commented Apr 2, 2013

Copy link
Copy Markdown

The PDO connection shouldn't end when the cursor is closed. This behavior was introduced 3 years ago when pdo_dblib was adjusted for multiple rowsets (3a069e8), only on versions 5.4+.

This prevents further queries to the same connection, transactions, the usage of variables and even getting multiple rowsets with that connection (this wasn't working on 5.4.13).

This is a bugfix for https://bugs.php.net/bug.php?id=64522. Tested and the expected results were met. Should be applied to branches PHP-5.4 and PHP-5.5.

Cheers,

Guilherme Capilé

@ssufficool

Copy link
Copy Markdown

This does fix one issue, but introduces another. When not all results are fetched and another statement is issued on the connection, the server will return and error of "Attempt to issue another command on a connection with pending results". The existing dbcancel() should cancel the command batch, but not close the connection. It is instead closing the dbhandle for some reason.

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

Successfully merging this pull request may close these issues.

3 participants