summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2007-01-07 04:36:40 +0000
committerIlia Alshanetsky <iliaa@php.net>2007-01-07 04:36:40 +0000
commit5babb6d10da45b00d043f7a0a313a5d6cac87211 (patch)
tree85d69ccb98fa95af4b9f79c0181d21e70b83d3bb /ext/pgsql
parent5068511748861c9dbeb603ec704f07bf81959901 (diff)
downloadphp-git-5babb6d10da45b00d043f7a0a313a5d6cac87211.tar.gz
Fixed bug #39979 (PGSQL_CONNECT_FORCE_NEW will causes next connect to
establish a new connection).
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index e5c9fd823f..d055170c19 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -629,6 +629,16 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
smart_str_appends(&str, "pgsql");
for (i = 0; i < ZEND_NUM_ARGS(); i++) {
+ /* make sure that the PGSQL_CONNECT_FORCE_NEW bit is not part of the hash so that subsequent connections
+ * can re-use this connection. Bug #39979
+ */
+ if (i == 1 && ZEND_NUM_ARGS() == 2 && Z_TYPE_PP(args[i]) == IS_LONG) {
+ if (Z_LVAL_PP(args[1]) == PGSQL_CONNECT_FORCE_NEW) {
+ continue;
+ } else if (Z_LVAL_PP(args[1]) & PGSQL_CONNECT_FORCE_NEW) {
+ smart_str_append_long(&str, Z_LVAL_PP(args[1]) ^ PGSQL_CONNECT_FORCE_NEW);
+ }
+ }
convert_to_string_ex(args[i]);
smart_str_appendc(&str, '_');
smart_str_appendl(&str, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i]));