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

Closed
opened 2026-01-22 13:48:56 +01:00 by admin · 4 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:56 +01:00
admin closed this issue 2026-01-22 13:48:56 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 8, 2012):

Comment created by @ocramius:

I think this has already been fixed in latest master and 2.1.7. Could you just give it a try and eventually confirm?

@doctrinebot commented on GitHub (Jun 8, 2012): Comment created by @ocramius: I think this has already been fixed in latest master and 2.1.7. Could you just give it a try and eventually confirm?
Author
Owner

@doctrinebot commented on GitHub (Jun 8, 2012):

Comment created by abhoryo:

Already try with 2.17, 2.20 and 2.2.2. This hasn't been fixed.

@doctrinebot commented on GitHub (Jun 8, 2012): Comment created by abhoryo: Already try with 2.17, 2.20 and 2.2.2. This hasn't been fixed.
Author
Owner

@doctrinebot commented on GitHub (Jul 4, 2012):

Comment created by @beberlei:

Duplicate of DDC-1858

@doctrinebot commented on GitHub (Jul 4, 2012): Comment created by @beberlei: Duplicate of [DDC-1858](http://www.doctrine-project.org/jira/browse/DDC-1858)
Author
Owner

@doctrinebot commented on GitHub (Jul 4, 2012):

Issue was closed with resolution "Duplicate"

@doctrinebot commented on GitHub (Jul 4, 2012): Issue was closed with resolution "Duplicate"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2342