mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
- seperate queries and cached queries
- display correct read/unread information while displaying active topics - fix for SELECT DISTINCT in mssql using sql_query_limit - fix for forum updating in ACP using mssql (and probably other dbal having problems with primary keys in updates) git-svn-id: file:///svn/phpbb/trunk@5940 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -104,11 +104,10 @@ class dbal_mssql_odbc extends dbal
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
|
||||
if (!$this->query_result)
|
||||
{
|
||||
$this->num_queries++;
|
||||
|
||||
if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false)
|
||||
{
|
||||
$this->sql_error($query);
|
||||
@@ -160,7 +159,14 @@ class dbal_mssql_odbc extends dbal
|
||||
$row_offset = ($total) ? $offset : '';
|
||||
$num_rows = ($total) ? $total : $offset;
|
||||
|
||||
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
|
||||
if (strpos($query, 'SELECT DISTINCT') === 0)
|
||||
{
|
||||
$query = 'SELECT DISTINCT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
|
||||
}
|
||||
|
||||
return $this->sql_query($query, $cache_ttl);
|
||||
}
|
||||
|
Reference in New Issue
Block a user