aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver/mssql.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-22 19:34:02 +0200
committerTristan Darricau <github@nicofuma.fr>2014-06-22 19:34:02 +0200
commitadba7d471583537fb20c18dca08c571909171aeb (patch)
treef0a5033e9af638b5ac1d7bccb1a86fbed5cd3d91 /phpBB/phpbb/db/driver/mssql.php
parent2276c1c0f246a39dee8d0e979c89e8de0ee7a5de (diff)
downloadforums-adba7d471583537fb20c18dca08c571909171aeb.tar
forums-adba7d471583537fb20c18dca08c571909171aeb.tar.gz
forums-adba7d471583537fb20c18dca08c571909171aeb.tar.bz2
forums-adba7d471583537fb20c18dca08c571909171aeb.tar.xz
forums-adba7d471583537fb20c18dca08c571909171aeb.zip
[ticket/12387] mssql_query return true if a select query returns 0 row
PHPBB3-12387
Diffstat (limited to 'phpBB/phpbb/db/driver/mssql.php')
-rw-r--r--phpBB/phpbb/db/driver/mssql.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php
index 14a9fd938c..0809703b48 100644
--- a/phpBB/phpbb/db/driver/mssql.php
+++ b/phpBB/phpbb/db/driver/mssql.php
@@ -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);