summaryrefslogtreecommitdiff
path: root/includes/database/select.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-09 17:23:50 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-09 17:23:50 +0000
commit8de2de0206929c9e72cd07dc987e3263970e0829 (patch)
tree72e59f428440e3a10a8ea6ab3dff9734cf97e8ab /includes/database/select.inc
parent620a306ea42e24af211d41257fcc35d41eb33ab0 (diff)
downloadbrdo-8de2de0206929c9e72cd07dc987e3263970e0829.tar.gz
brdo-8de2de0206929c9e72cd07dc987e3263970e0829.tar.bz2
- Patch #653926 by Damien Tournoud: fixed range of sub-queries not being honored.
Diffstat (limited to 'includes/database/select.inc')
-rw-r--r--includes/database/select.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/includes/database/select.inc b/includes/database/select.inc
index 84a01f294..3b9643b1e 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -1085,10 +1085,6 @@ class SelectQuery extends Query implements SelectQueryInterface {
}
$args = $this->getArguments();
-
- if (!empty($this->range)) {
- return $this->connection->queryRange((string)$this, $this->range['start'], $this->range['length'], $args, $this->queryOptions);
- }
return $this->connection->query((string)$this, $args, $this->queryOptions);
}
@@ -1358,7 +1354,10 @@ class SelectQuery extends Query implements SelectQueryInterface {
$query .= implode(', ', $fields);
}
- // RANGE is database specific, so we can't do it here.
+ // RANGE
+ if (!empty($this->range)) {
+ $query .= "\nLIMIT " . $this->range['length'] . " OFFSET " . $this->range['start'];
+ }
// UNION is a little odd, as the select queries to combine are passed into
// this query, but syntactically they all end up on the same level.