mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12387] mssql_query return true if a select query returns 0 row
PHPBB3-12387
This commit is contained in:
parent
2276c1c0f2
commit
adba7d4715
1 changed files with 12 additions and 2 deletions
|
@ -163,7 +163,7 @@ class mssql extends \phpbb\db\driver\driver
|
|||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
|
||||
}
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result)
|
||||
else if (strpos($query, 'SELECT') === 0 && $this->query_result !== true)
|
||||
{
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ class mssql extends \phpbb\db\driver\driver
|
|||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
|
||||
if (!$query_id)
|
||||
if (!$query_id || $query_id === true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -269,6 +269,11 @@ class mssql extends \phpbb\db\driver\driver
|
|||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if ($query_id === true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($cache && $cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
|
@ -308,6 +313,11 @@ class mssql extends \phpbb\db\driver\driver
|
|||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if ($query_id === true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
|
||||
{
|
||||
return $cache->sql_freeresult($query_id);
|
||||
|
|
Loading…
Add table
Reference in a new issue