mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-17 22:28:46 +01:00
[ticket/16740] Improve open queries handling & do not close freed connection
PHPBB3-16740
This commit is contained in:
parent
03824189e4
commit
c99bfe116f
@ -386,9 +386,9 @@ class postgres extends \phpbb\db\driver\driver
|
||||
return $cache->sql_freeresult($safe_query_id);
|
||||
}
|
||||
|
||||
if (isset($this->open_queries[(int) $safe_query_id]))
|
||||
if (isset($this->open_queries[$safe_query_id]))
|
||||
{
|
||||
unset($this->open_queries[(int) $safe_query_id]);
|
||||
unset($this->open_queries[$safe_query_id]);
|
||||
return pg_free_result($query_id);
|
||||
}
|
||||
|
||||
@ -466,6 +466,11 @@ class postgres extends \phpbb\db\driver\driver
|
||||
*/
|
||||
function _sql_close()
|
||||
{
|
||||
// Released resources are already closed, return true in this case
|
||||
if (get_resource_type($this->db_connect_id) === 'Unknown')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return @pg_close($this->db_connect_id);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ abstract class phpbb_database_test_case extends TestCase
|
||||
|
||||
static protected $install_schema_file;
|
||||
|
||||
static protected $phpunit_version;
|
||||
static protected $phpunit_version;
|
||||
|
||||
public function __construct($name = NULL, array $data = [], $dataName = '')
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user