Commit b025761f authored by webchick's avatar webchick

Issue #2315269 by sun: Fixed Entity/Query/Sql/QueryAggregate: PDOException:...

Issue #2315269 by sun: Fixed Entity/Query/Sql/QueryAggregate: PDOException: General error: GROUP BY clause is required before HAVING.
parent fd0be046
......@@ -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)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment