From 4eded3fef45f2f0354a5675eb4d81b5b3d4be164 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 27 Feb 2024 19:45:24 +0000 Subject: [PATCH 1/3] trigger --- ext/pgsql/pgsql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 9b2488a5eb889..4b8dbf8da9b44 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -314,7 +314,7 @@ static void _close_pgsql_plink(zend_resource *rsrc) PQclear(res); } PQfinish(link); - /* See https://github.com/php/php-src/issues/12974 why we need to check the if */ + /* #ifdef ZTS if (pgsql_module_entry.module_started) #endif @@ -322,6 +322,7 @@ static void _close_pgsql_plink(zend_resource *rsrc) PGG(num_persistent)--; PGG(num_links)--; } + */ rsrc->ptr = NULL; } From ef41a604400c52291437e58543bc67ddf7d177cf Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 27 Feb 2024 20:14:55 +0000 Subject: [PATCH 2/3] trigger --- ext/pgsql/pgsql.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 4b8dbf8da9b44..6ce1fbac3b992 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -314,15 +314,6 @@ static void _close_pgsql_plink(zend_resource *rsrc) PQclear(res); } PQfinish(link); - /* -#ifdef ZTS - if (pgsql_module_entry.module_started) -#endif - { - PGG(num_persistent)--; - PGG(num_links)--; - } - */ rsrc->ptr = NULL; } From 3547234e681593e7429f41788c71e804909eb881 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 27 Feb 2024 20:19:43 +0000 Subject: [PATCH 3/3] trigger --- ext/pgsql/pgsql.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 6ce1fbac3b992..01230159bb1ea 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -314,6 +314,14 @@ static void _close_pgsql_plink(zend_resource *rsrc) PQclear(res); } PQfinish(link); + /* See https://github.com/php/php-src/issues/12974 why we need to check the if */ +#ifdef ZTS + if (pgsql_module_entry.module_started) +#endif + { + //PGG(num_persistent)--; + //PGG(num_links)--; + } rsrc->ptr = NULL; }