diff options
author | Andreas Fischer <bantu@phpbb.com> | 2010-04-06 17:56:54 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-05-14 02:22:24 +0200 |
commit | 970848409d40040b3fdc07f45183935f7419b527 (patch) | |
tree | a4bb9d00856c44e9b25807f73e8b074631cd13c6 /phpBB/includes | |
parent | 925a135613a80ba9bfc3b26a2524d3c2d3ba77b3 (diff) | |
download | forums-970848409d40040b3fdc07f45183935f7419b527.tar forums-970848409d40040b3fdc07f45183935f7419b527.tar.gz forums-970848409d40040b3fdc07f45183935f7419b527.tar.bz2 forums-970848409d40040b3fdc07f45183935f7419b527.tar.xz forums-970848409d40040b3fdc07f45183935f7419b527.zip |
[ticket/9518] Correctly create new connection on PostgreSQL when new connection is forced.
pg_connect() takes an integer as the second parameter, but we were passing a boolean parameter. The function especially requires passing the PGSQL_CONNECT_FORCE_NEW constant if a new connection is to be forced. Passing 0 as the second parameter for 'do not force a new connection' doesn't work as expected, hence we're calling the function without a second parameter in this case.
PHPBB3-9518
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/db/postgres.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index d117e8c948..b3139b3d79 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -76,7 +76,14 @@ class dbal_postgres extends dbal $this->persistency = $persistency; - $this->db_connect_id = ($this->persistency) ? @pg_pconnect($connect_string, $new_link) : @pg_connect($connect_string, $new_link); + if ($this->persistency) + { + $this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW); + } + else + { + $this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW); + } if ($this->db_connect_id) { |