mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-21 07:51:33 +02:00
[ticket/12387] Cleanup *_free_result call and remove @ on that call
PHPBB3-12387
This commit is contained in:
@@ -98,8 +98,8 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
$row = false;
|
||||
if ($result_id)
|
||||
{
|
||||
$row = @odbc_fetch_array($result_id);
|
||||
@odbc_free_result($result_id);
|
||||
$row = odbc_fetch_array($result_id);
|
||||
odbc_free_result($result_id);
|
||||
}
|
||||
|
||||
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
|
||||
@@ -173,6 +173,11 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if (!$this->query_result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($cache && $cache_ttl)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
@@ -253,7 +258,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
|
||||
return ($query_id !== false) ? @odbc_fetch_array($query_id) : false;
|
||||
return ($query_id) ? odbc_fetch_array($query_id) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,13 +270,13 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
|
||||
if ($result_id)
|
||||
{
|
||||
if (@odbc_fetch_array($result_id))
|
||||
if (odbc_fetch_array($result_id))
|
||||
{
|
||||
$id = @odbc_result($result_id, 1);
|
||||
@odbc_free_result($result_id);
|
||||
$id = odbc_result($result_id, 1);
|
||||
odbc_free_result($result_id);
|
||||
return $id;
|
||||
}
|
||||
@odbc_free_result($result_id);
|
||||
odbc_free_result($result_id);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -297,7 +302,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
if (isset($this->open_queries[(int) $query_id]))
|
||||
{
|
||||
unset($this->open_queries[(int) $query_id]);
|
||||
return @odbc_free_result($query_id);
|
||||
return odbc_free_result($query_id);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -352,11 +357,14 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
$endtime = $endtime[0] + $endtime[1];
|
||||
|
||||
$result = @odbc_exec($this->db_connect_id, $query);
|
||||
while ($void = @odbc_fetch_array($result))
|
||||
if ($result)
|
||||
{
|
||||
// Take the time spent on parsing rows into account
|
||||
while ($void = odbc_fetch_array($result))
|
||||
{
|
||||
// Take the time spent on parsing rows into account
|
||||
}
|
||||
odbc_free_result($result);
|
||||
}
|
||||
@odbc_free_result($result);
|
||||
|
||||
$splittime = explode(' ', microtime());
|
||||
$splittime = $splittime[0] + $splittime[1];
|
||||
|
Reference in New Issue
Block a user