Merge branch 'DDC-1036'
This commit is contained in:
commit
99c7924292
@ -2390,7 +2390,7 @@ class Parser
|
||||
|
||||
$functionName = $this->_lexer->token['value'];
|
||||
$this->match(Lexer::T_OPEN_PARENTHESIS);
|
||||
$pathExp = $this->StateFieldPathExpression();
|
||||
$pathExp = $this->SimpleArithmeticExpression();
|
||||
$this->match(Lexer::T_CLOSE_PARENTHESIS);
|
||||
}
|
||||
|
||||
|
@ -1243,7 +1243,7 @@ class SqlWalker implements TreeWalker
|
||||
public function walkAggregateExpression($aggExpression)
|
||||
{
|
||||
return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '')
|
||||
. $this->walkPathExpression($aggExpression->pathExpression) . ')';
|
||||
. $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,6 +209,14 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testSupportsAggregateFunctionWithSimpleArithmetic()
|
||||
{
|
||||
$this->assertSqlGeneration(
|
||||
'SELECT MAX(u.id + 4) * 2 FROM Doctrine\Tests\Models\CMS\CmsUser u',
|
||||
'SELECT MAX(c0_.id + 4) * 2 AS sclr0 FROM cms_users c0_'
|
||||
);
|
||||
}
|
||||
|
||||
public function testSupportsWhereClauseWithPositionalParameter()
|
||||
{
|
||||
$this->assertSqlGeneration(
|
||||
|
Loading…
x
Reference in New Issue
Block a user