From 955b9de6509e65717fe3b5eb5146c58b39528820 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 27 Feb 2024 22:30:40 +0000 Subject: [PATCH] Revert "Fix GH-13519: PGSQL_CONNECT_FORCE_RENEW with persistent connections." This reverts commit b9a9790be0657249fa5e6687883b43570b0a3f1f. --- NEWS | 2 -- ext/pgsql/pgsql.c | 7 ------- ext/pgsql/tests/gh13519.phpt | 30 ------------------------------ 3 files changed, 39 deletions(-) delete mode 100644 ext/pgsql/tests/gh13519.phpt diff --git a/NEWS b/NEWS index ad388c3562339..fa1a89dd1b063 100644 --- a/NEWS +++ b/NEWS @@ -44,8 +44,6 @@ PHP NEWS - PGSQL: . Fixed bug GH-13354 (pg_execute/pg_send_query_params/pg_send_execute with null value passed by reference). (George Barbarosie) - . Fixed bug GH-13519 (PGSQL_CONNECT_FORCE_RENEW not working with persistent - connections. (David Carlier) - Standard: . Fixed array key as hash to string (case insensitive) comparison typo diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 9b2488a5eb889..6e04848bdea0b 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -562,7 +562,6 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* try to find if we already have this link in our persistent list */ if ((le = zend_hash_find_ptr(&EG(persistent_list), str.s)) == NULL) { /* we don't */ -newpconn: if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) { php_error_docref(NULL, E_WARNING, "Cannot create new link. Too many open links (" ZEND_LONG_FMT ")", PGG(num_links)); @@ -591,12 +590,6 @@ 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; } diff --git a/ext/pgsql/tests/gh13519.phpt b/ext/pgsql/tests/gh13519.phpt deleted file mode 100644 index 17379cdacce71..0000000000000 --- a/ext/pgsql/tests/gh13519.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -GH-13519 - PGSQL_CONNECT_FORCE_NEW with persistent connections. ---EXTENSIONS-- -pgsql ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false)