mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/12387] mssql_query return true if a select query returns 0 row
PHPBB3-12387
This commit is contained in:
@@ -163,7 +163,7 @@ class mssql extends \phpbb\db\driver\driver
|
|||||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||||
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
|
$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;
|
$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);
|
return $cache->sql_fetchrow($query_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$query_id)
|
if (!$query_id || $query_id === true)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -269,6 +269,11 @@ class mssql extends \phpbb\db\driver\driver
|
|||||||
$query_id = $this->query_result;
|
$query_id = $this->query_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($query_id === true)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($cache && $cache->sql_exists($query_id))
|
if ($cache && $cache->sql_exists($query_id))
|
||||||
{
|
{
|
||||||
return $cache->sql_rowseek($rownum, $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;
|
$query_id = $this->query_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($query_id === true)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
|
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
|
||||||
{
|
{
|
||||||
return $cache->sql_freeresult($query_id);
|
return $cache->sql_freeresult($query_id);
|
||||||
|
Reference in New Issue
Block a user