From 6d5925708eb4f4a296ebc56077a1fa6dc08cc802 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 3 Apr 2013 12:22:12 +0200 Subject: [PATCH] FIX Empty fields on SQLQuery->aggregate() with alias Breaks Postgres otherwise, because it produces a "SELECT *, ... " statement without putting all fields into the GROUP BY. --- model/SQLQuery.php | 1 + 1 file changed, 1 insertion(+) diff --git a/model/SQLQuery.php b/model/SQLQuery.php index e23e191c17c..ec84d0e7c5a 100644 --- a/model/SQLQuery.php +++ b/model/SQLQuery.php @@ -1071,6 +1071,7 @@ public function aggregate($column, $alias = null) { $clone->setOrderBy($this->orderby); $clone->setGroupBy($this->groupby); if($alias) { + $clone->setSelect(array()); $clone->selectField($column, $alias); } else { $clone->setSelect($column);