Skip to content

Commit

Permalink
Fixed OFFSET clause for SQLServer
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Apr 12, 2014
1 parent 3bf580d commit d7213e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Database/Dialect/SqlserverDialectTrait.php
Expand Up @@ -64,7 +64,7 @@ protected function _selectQueryTranslator($query) {
$query->limit(null);

if (!$query->clause('order')) {
$query->order([(string)$query->connection()->newQuery()->select(['NULL'])]);
$query->order([$query->connection()->newQuery()->select(['NULL'])]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/OrderByExpression.php
Expand Up @@ -40,7 +40,7 @@ public function sql(ValueBinder $generator) {
$order = [];
foreach ($this->_conditions as $k => $direction) {
if ($direction instanceof ExpressionInterface) {
$direction = $direction->sql($generator);
$direction = sprintf('(%s)', $direction->sql($generator));
}
$order[] = is_numeric($k) ? $direction : sprintf('%s %s', $k, $direction);
}
Expand Down

0 comments on commit d7213e0

Please sign in to comment.