mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[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
This commit is contained in:
parent
925a135613
commit
970848409d
1 changed files with 8 additions and 1 deletions
|
@ -76,7 +76,14 @@ class dbal_postgres extends dbal
|
||||||
|
|
||||||
$this->persistency = $persistency;
|
$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)
|
if ($this->db_connect_id)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue