DDC-2827 Added support for AggregateExpressions in NullComparisonExpression.
This commit is contained in:
parent
ceada41b83
commit
841bdd5ca5
@ -1647,7 +1647,7 @@ QUANTIFIED/BETWEEN/COMPARISON/LIKE/NULL/EXISTS
|
||||
InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "(" InstanceOfParameter {"," InstanceOfParameter}* ")")
|
||||
InstanceOfParameter ::= AbstractSchemaName | InputParameter
|
||||
LikeExpression ::= StringExpression ["NOT"] "LIKE" StringPrimary ["ESCAPE" char]
|
||||
NullComparisonExpression ::= (InputParameter | NullIfExpression | CoalesceExpression | SingleValuedPathExpression | ResultVariable) "IS" ["NOT"] "NULL"
|
||||
NullComparisonExpression ::= (InputParameter | NullIfExpression | CoalesceExpression | AggregateExpression | FunctionDeclaration | IdentificationVariable | SingleValuedPathExpression | ResultVariable) "IS" ["NOT"] "NULL"
|
||||
ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
|
||||
ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
|
||||
|
||||
|
@ -3131,7 +3131,7 @@ class Parser
|
||||
}
|
||||
|
||||
/**
|
||||
* NullComparisonExpression ::= (InputParameter | NullIfExpression | CoalesceExpression | SingleValuedPathExpression | ResultVariable) "IS" ["NOT"] "NULL"
|
||||
* NullComparisonExpression ::= (InputParameter | NullIfExpression | CoalesceExpression | AggregateExpression | FunctionDeclaration | IdentificationVariable | SingleValuedPathExpression | ResultVariable) "IS" ["NOT"] "NULL"
|
||||
*
|
||||
* @return \Doctrine\ORM\Query\AST\NullComparisonExpression
|
||||
*/
|
||||
@ -3151,6 +3151,10 @@ class Parser
|
||||
case $this->lexer->isNextToken(Lexer::T_COALESCE):
|
||||
$expr = $this->CoalesceExpression();
|
||||
break;
|
||||
|
||||
case $this->isAggregateFunction($this->lexer->lookahead['type']):
|
||||
$expr = $this->AggregateExpression();
|
||||
break;
|
||||
|
||||
case $this->isFunction():
|
||||
$expr = $this->FunctionDeclaration();
|
||||
|
@ -2062,6 +2062,11 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
|
||||
'SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING u.username IS NULL',
|
||||
'SELECT c0_.name AS name_0 FROM cms_users c0_ HAVING c0_.username IS NULL'
|
||||
);
|
||||
|
||||
$this->assertSqlGeneration(
|
||||
'SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING MAX(u.name) IS NULL',
|
||||
'SELECT c0_.name AS name_0 FROM cms_users c0_ HAVING MAX(c0_.name) IS NULL'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user