1
0
mirror of synced 2024-12-13 06:46:03 +03:00

[2.0] DDC-375 - Fix a little bug in walkSimpleSelectExpression

This commit is contained in:
beberlei 2010-02-25 20:31:53 +00:00
parent 66783529dc
commit 248022249f
2 changed files with 2 additions and 2 deletions

View File

@ -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;
} }

View File

@ -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'"
); );
} }
} }