Skip to content

Commit

Permalink
Merge 6ad45ed into 5a90ee0
Browse files Browse the repository at this point in the history
  • Loading branch information
dalibert42 committed Aug 17, 2016
2 parents 5a90ee0 + 6ad45ed commit 28c3f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SQLParser/Query/Select.php
Expand Up @@ -350,7 +350,7 @@ public function toSql(array $parameters = array(), Connection $dbConnection = nu
}

if (!empty($this->group)) {
$groupBy = NodeFactory::toSql($this->group, $dbConnection, $parameters, ' ', false, $indent + 2, $conditionsMode);
$groupBy = NodeFactory::toSql($this->group, $dbConnection, $parameters, ',', false, $indent + 2, $conditionsMode);
if ($groupBy) {
$sql .= "\nGROUP BY ".$groupBy;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Mouf/Database/MagicQueryTest.php
Expand Up @@ -118,6 +118,8 @@ public function testStandardSelect()
$sql = 'SELECT \'hello\' as toto FROM users';
$this->assertEquals('SELECT \'hello\' AS toto FROM users', self::simplifySql($magicQuery->build($sql)));

$sql = 'SELECT * FROM users GROUP BY id, login';
$this->assertEquals('SELECT * FROM users GROUP BY id, login', self::simplifySql($magicQuery->build($sql)));
}

/**
Expand Down

0 comments on commit 28c3f86

Please sign in to comment.