From b025761f55b42a5e10cfe380d1806c127f045e32 Mon Sep 17 00:00:00 2001 From: webchick <drupal@webchick.net> Date: Sun, 24 Aug 2014 13:19:02 -0700 Subject: [PATCH] Issue #2315269 by sun: Fixed Entity/Query/Sql/QueryAggregate: PDOException: General error: GROUP BY clause is required before HAVING. --- .../system/src/Tests/Entity/EntityQueryAggregateTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php index 1f9c52c490ac..5d6da727052e 100644 --- a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php +++ b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php @@ -160,12 +160,14 @@ public function testAggregation() { // Apply aggregation and a condition which matches. $this->queryResult = $this->factory->getAggregate('entity_test') ->aggregate('id', 'COUNT') + ->groupBy('id') ->conditionAggregate('id', 'COUNT', 8) ->execute(); $this->assertResults(array()); // Don't call aggregate to test the implicit aggregate call. $this->queryResult = $this->factory->getAggregate('entity_test') + ->groupBy('id') ->conditionAggregate('id', 'COUNT', 8) ->execute(); $this->assertResults(array()); @@ -173,6 +175,7 @@ public function testAggregation() { // Apply aggregation and a condition which matches. $this->queryResult = $this->factory->getAggregate('entity_test') ->aggregate('id', 'count') + ->groupBy('id') ->conditionAggregate('id', 'COUNT', 6) ->execute(); $this->assertResults(array(array('id_count' => 6))); -- GitLab