aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-08 20:26:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-08 20:26:03 +0000
commitef08df567522851202b09715c6b4bdef0c386403 (patch)
treef48e3798b2983a893c49943ac849be1d8a1ee5c7 /phpBB/includes/db
parent580a318d1624e76e258c5aa9a151e45f59bc7b91 (diff)
downloadforums-ef08df567522851202b09715c6b4bdef0c386403.tar
forums-ef08df567522851202b09715c6b4bdef0c386403.tar.gz
forums-ef08df567522851202b09715c6b4bdef0c386403.tar.bz2
forums-ef08df567522851202b09715c6b4bdef0c386403.tar.xz
forums-ef08df567522851202b09715c6b4bdef0c386403.zip
- bugfix roll
- fixed sql_query_limit on mssql/mssql_odbc git-svn-id: file:///svn/phpbb/trunk@6024 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/mssql.php10
-rw-r--r--phpBB/includes/db/mssql_odbc.php15
2 files changed, 22 insertions, 3 deletions
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index ef6f406edc..2f76f90bbb 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -159,7 +159,15 @@ class dbal_mssql extends dbal
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
}
- return $this->sql_query($query, $cache_ttl);
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $row_offset rows
+ if ($row_offset)
+ {
+ $this->sql_rowseek($result, $row_offset);
+ }
+
+ return $result;
}
else
{
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 0ae0d7e770..80ae25c4be 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -146,7 +146,7 @@ class dbal_mssql_odbc extends dbal
$total = -1;
}
- $row_offset = ($total) ? $offset : '';
+ $row_offset = ($total) ? $offset : 0;
$num_rows = ($total) ? $total : $offset;
if (strpos($query, 'SELECT DISTINCT') === 0)
@@ -158,7 +158,18 @@ class dbal_mssql_odbc extends dbal
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
}
- return $this->sql_query($query, $cache_ttl);
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $row_offset rows
+ if ($row_offset)
+ {
+ for ($i = 0; $i < $row_offset; $i++)
+ {
+ $this->sql_fetchrow($result);
+ }
+ }
+
+ return $result;
}
else
{