[DDC-593] Fixed.
This commit is contained in:
parent
3b01277fd4
commit
3045507a9b
@ -1620,7 +1620,7 @@ class SqlWalker implements TreeWalker
|
|||||||
{
|
{
|
||||||
return ($arithmeticExpr->isSimpleArithmeticExpression())
|
return ($arithmeticExpr->isSimpleArithmeticExpression())
|
||||||
? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression)
|
? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression)
|
||||||
: $this->walkSubselect($arithmeticExpr->subselect);
|
: '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -325,6 +325,17 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group DDC-593
|
||||||
|
*/
|
||||||
|
public function testSubqueriesInComparisonExpression()
|
||||||
|
{
|
||||||
|
$this->assertSqlGeneration(
|
||||||
|
'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (u.id >= (SELECT u2.id FROM Doctrine\Tests\Models\CMS\CmsUser u2 WHERE u2.name = :name)) AND (u.id <= (SELECT u3.id FROM Doctrine\Tests\Models\CMS\CmsUser u3 WHERE u3.name = :name))',
|
||||||
|
'SELECT c0_.id AS id0, c0_.status AS status1, c0_.username AS username2, c0_.name AS name3 FROM cms_users c0_ WHERE (c0_.id >= (SELECT c1_.id FROM cms_users c1_ WHERE c1_.name = ?)) AND (c0_.id <= (SELECT c2_.id FROM cms_users c2_ WHERE c2_.name = ?))'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testSupportsMemberOfExpression()
|
public function testSupportsMemberOfExpression()
|
||||||
{
|
{
|
||||||
// "Get all users who have $phone as a phonenumber." (*cough* doesnt really make sense...)
|
// "Get all users who have $phone as a phonenumber." (*cough* doesnt really make sense...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user