Skip to content

Revert "Fix GH-13519: PGSQL_CONNECT_FORCE_RENEW with persistent conne… #13546

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

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}
Expand Down
30 changes: 0 additions & 30 deletions ext/pgsql/tests/gh13519.phpt

This file was deleted.