From 2b755a663bbaeab0aa560147f7d69210a1c1e923 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 27 Feb 2024 20:40:15 +0000 Subject: [PATCH] trying possible fix on master --- ext/pgsql/pgsql.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index cf0ffcfd88284..b95a060f28813 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -589,15 +589,17 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) PGG(num_links)++; PGG(num_persistent)++; } else { /* we do */ - if ((connect_type & PGSQL_CONNECT_FORCE_NEW)) { - if (zend_hash_del(&EG(persistent_list), str.s) != SUCCESS) { - goto err; - } - goto newpconn; - } if (le->type != le_plink) { goto err; } + if ((connect_type & PGSQL_CONNECT_FORCE_NEW)) { + pgsql = (PGconn *) le->ptr; + PQfinish(pgsql); + PGG(num_links)--; + PGG(num_persistent)--; + le->ptr = NULL; + goto newpconn; + } /* ensure that the link did not die */ if (PGG(auto_reset_persistent) & 1) { /* need to send & get something from backend to