DDC-3743: There is a BC break in the ORM 2.5 in the DQL parser #4592

Open
opened 2026-01-22 14:45:31 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (May 22, 2015).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user stof:

The following DQL query is working fine on 2.4 but breaks on 2.5:

SELECT COUNT(l) FROM Incenteev\WebBundle\Entity\Discussion\Liker l INNER JOIN l.message m INNER JOIN m.thread t WHERE t.space IN (:space_ids) AND l.date >= :from

This is the exception triggered in 2.5:

[Semantical Error] line 0, col 13 near 'l) FROM Incenteev\WebBundle\Entity\Discussion\Liker': Error: Invalid PathExpression. Must be a StateFieldPathExpression. 

The exception happens in Parser->processDeferredPathExpressions.

The Liker class has a compound identifier based on 2 relations.

I suspect it is related to https://github.com/doctrine/doctrine2/pull/1122

Originally created by @doctrinebot on GitHub (May 22, 2015). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user stof: The following DQL query is working fine on 2.4 but breaks on 2.5: ``` SELECT COUNT(l) FROM Incenteev\WebBundle\Entity\Discussion\Liker l INNER JOIN l.message m INNER JOIN m.thread t WHERE t.space IN (:space_ids) AND l.date >= :from ``` This is the exception triggered in 2.5: ``` [Semantical Error] line 0, col 13 near 'l) FROM Incenteev\WebBundle\Entity\Discussion\Liker': Error: Invalid PathExpression. Must be a StateFieldPathExpression. ``` The exception happens in `Parser->processDeferredPathExpressions`. The Liker class has a compound identifier based on 2 relations. I suspect it is related to https://github.com/doctrine/doctrine2/pull/1122
admin added the Bug label 2026-01-22 14:45:31 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 22, 2015):

Comment created by stof:

I'm not sure it is a BC break though. Looking at the SQL generated in 2.4, it was not counting the right thing (is was counting only the message ids, not the combination message id/user id being the primary key.

@doctrinebot commented on GitHub (May 22, 2015): Comment created by stof: I'm not sure it is a BC break though. Looking at the SQL generated in 2.4, it was not counting the right thing (is was counting only the message ids, not the combination message id/user id being the primary key.
Author
Owner

@doctrinebot commented on GitHub (May 28, 2015):

Comment created by stof:

Actually, it was counting the right thing when not using DISTINCT (the 2.4 generated SQL was broken for DISTINCT though)

@doctrinebot commented on GitHub (May 28, 2015): Comment created by stof: Actually, it was counting the right thing when not using DISTINCT (the 2.4 generated SQL was broken for DISTINCT though)
Author
Owner

@doctrinebot commented on GitHub (May 28, 2015):

Comment created by @guilhermeblanco:

Yep, that PR was the culript. I can look into this issue later.

@doctrinebot commented on GitHub (May 28, 2015): Comment created by @guilhermeblanco: Yep, that PR was the culript. I can look into this issue later.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4592