Skip to content

Commit

Permalink
Changed to proper format the order by in sqlserver
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Jan 20, 2014
1 parent 2af86ad commit e9d46bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Database/Dialect/SqlserverDialectTrait.php
Expand Up @@ -52,7 +52,6 @@ protected function _selectQueryTranslator($query) {

if ($limit && $offset === null) {
// @todo implement TOP
$query->clause('order') || $query->order([$query->connection()->newQuery()->select(['NULL'])]);
throw new \Cake\Error\NotImplementedException();
}

Expand All @@ -64,7 +63,9 @@ protected function _selectQueryTranslator($query) {
$query->offset($query->newExpr()->add($offsetSql));
$query->limit(null);

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

return $query;
Expand Down

0 comments on commit e9d46bf

Please sign in to comment.