mirror of
https://github.com/danog/ext-pq.git
synced 2024-12-02 17:28:35 +01:00
only rollback if transaction status indicates need of action
This commit is contained in:
parent
a09c92a19b
commit
3bb2c115b2
@ -1803,8 +1803,9 @@ static void php_pqconn_persistent_resource_factory_dtor(void *opaque, void *hand
|
|||||||
{
|
{
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
|
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
if ((res = PQexec(handle, "ROLLBACK; RESET ALL;"))) {
|
if ((res = PQexec(handle, PQtransactionStatus(handle) == PQTRANS_IDLE ? "RESET ALL" : "ROLLBACK; RESET ALL"))) {
|
||||||
PHP_PQclear(res);
|
PHP_PQclear(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user