Merge pull request #171 from silverstripe-scienceninjas/pull/fix-default-sorting-bugs-subtract

BUGFIX Subtract should not add order by on subselect
This commit is contained in:
Stig Lindqvist 2012-01-26 21:29:08 -08:00
commit 3f682531e6

View File

@ -514,7 +514,6 @@ class DataQuery {
public function subtract(DataQuery $subtractQuery, $field='ID') {
$subSelect= $subtractQuery->getFinalisedQuery();
$subSelect->select($this->expressionForField($field, $subSelect));
$this->ensureSelectContainsOrderbyColumns($subSelect);
$this->where($this->expressionForField($field, $this).' NOT IN ('.$subSelect->sql().')');
}