Merge pull request #801 from flip111/patch-4
Update SqlWalker.php fixed wrong GROUP BY clause on SQL Server platform
This commit is contained in:
commit
2c4c26c5d6
2 changed files with 11 additions and 2 deletions
|
@ -1624,6 +1624,16 @@ class SqlWalker implements TreeWalker
|
||||||
|
|
||||||
// ResultVariable
|
// ResultVariable
|
||||||
if (isset($this->queryComponents[$groupByItem]['resultVariable'])) {
|
if (isset($this->queryComponents[$groupByItem]['resultVariable'])) {
|
||||||
|
$resultVariable = $this->queryComponents[$groupByItem]['resultVariable'];
|
||||||
|
|
||||||
|
if ($resultVariable instanceof AST\PathExpression) {
|
||||||
|
return $this->walkPathExpression($resultVariable);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($resultVariable->pathExpression)) {
|
||||||
|
return $this->walkPathExpression($resultVariable->pathExpression);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->walkResultVariable($groupByItem);
|
return $this->walkResultVariable($groupByItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1584,7 +1584,7 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
|
||||||
{
|
{
|
||||||
$this->assertSqlGeneration(
|
$this->assertSqlGeneration(
|
||||||
'SELECT u, u.status AS st FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY st',
|
'SELECT u, u.status AS st FROM Doctrine\Tests\Models\CMS\CmsUser u GROUP BY st',
|
||||||
'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.status AS status4 FROM cms_users c0_ GROUP BY status4'
|
'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3, c0_.status AS status4 FROM cms_users c0_ GROUP BY c0_.status'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2268,4 +2268,3 @@ class DDC1474Entity
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue