[ticket/10057] Skip ibase_service_attach if firebird connection failed.

ibase_errmsg works for the most recent call. If the connection
fails, any error message is clobbered by ibase_service_attach call.

PHPBB3-10057
This commit is contained in:
Oleg Pudeyev 2011-03-06 23:07:48 -05:00
parent 4d92f9bb2e
commit edc1deaa3a

View file

@ -70,7 +70,9 @@ class dbal_firebird extends dbal
$this->db_connect_id = @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3); $this->db_connect_id = @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
} }
if (function_exists('ibase_service_attach') && $this->server) // Do not call ibase_service_attach if connection failed,
// otherwise error message from ibase_(p)connect call will be clobbered.
if ($this->db_connect_id && function_exists('ibase_service_attach') && $this->server)
{ {
$this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword); $this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword);
} }