DDC-1857: The Having clause with a DQL function only accepts comparison operators #2340

Open
opened 2026-01-22 13:48:52 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 7, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user abhoryo:

The Having clause with a DQL function only accepts comparison operators.

Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE'

Exemple of query:

SELECT _photos.active, min(_photos.title)
FROM Acme\CoreBundle\Entity\Photo _photos
GROUP BY _photos.active
HAVING min(_photos.title) LIKE 'mountain'

In Parser::SimpleConditionalExpression(), the parser doesn't understand the 'like' expression and see instead a 'min' expression.

If we return $this->LikeExpression() for this case, it works.

Is this a limitation or a bug ?

Originally created by @doctrinebot on GitHub (Jun 7, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user abhoryo: The Having clause with a DQL function only accepts comparison operators. Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE' Exemple of query: SELECT _photos.active, min(_photos.title) FROM Acme\CoreBundle\Entity\Photo _photos GROUP BY _photos.active HAVING min(_photos.title) LIKE 'mountain' In Parser::SimpleConditionalExpression(), the parser doesn't understand the 'like' expression and see instead a 'min' expression. If we return $this->LikeExpression() for this case, it works. Is this a limitation or a bug ?
admin added the Bug label 2026-01-22 13:48:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2340