[2.0] DDC-375 - Fix a little bug in walkSimpleSelectExpression
This commit is contained in:
parent
66783529dc
commit
248022249f
@ -1052,7 +1052,7 @@ class SqlWalker implements TreeWalker
|
|||||||
$sql .= ' ' . $this->walkPathExpression($expr);
|
$sql .= ' ' . $this->walkPathExpression($expr);
|
||||||
} else if ($expr instanceof AST\AggregateExpression) {
|
} else if ($expr instanceof AST\AggregateExpression) {
|
||||||
if ( ! $simpleSelectExpression->fieldIdentificationVariable) {
|
if ( ! $simpleSelectExpression->fieldIdentificationVariable) {
|
||||||
$alias = $this->_scalarAliasCounter++;
|
$alias = $this->_scalarResultCounter++;
|
||||||
} else {
|
} else {
|
||||||
$alias = $simpleSelectExpression->fieldIdentificationVariable;
|
$alias = $simpleSelectExpression->fieldIdentificationVariable;
|
||||||
}
|
}
|
||||||
|
@ -582,7 +582,7 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
{
|
{
|
||||||
$this->assertSqlGeneration(
|
$this->assertSqlGeneration(
|
||||||
"SELECT u.name, (SELECT COUNT(p.phonenumber) FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234) pcount FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'",
|
"SELECT u.name, (SELECT COUNT(p.phonenumber) FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.phonenumber = 1234) pcount FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = 'jon'",
|
||||||
"SELECT c0_.name AS name0, (SELECT COUNT(c1_.phonenumber) AS dctrn__ FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = 1234) AS sclr1 FROM cms_users c0_ WHERE c0_.name = 'jon'"
|
"SELECT c0_.name AS name0, (SELECT COUNT(c1_.phonenumber) AS dctrn__1 FROM cms_phonenumbers c1_ WHERE c1_.phonenumber = 1234) AS sclr1 FROM cms_users c0_ WHERE c0_.name = 'jon'"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user