Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDC-3939: BC Break in 2.5 Cannot add having condition on a non result variable #4799

Closed
doctrinebot opened this issue Oct 6, 2015 · 3 comments
Assignees
Labels

Comments

@doctrinebot
Copy link

Jira issue originally created by user tkleinhakisa:

Hello,

After upgrading to 2.5.1 the following query does not work anymore:

SELECT COUNT(m.id) as unread, conversation.id FROM Message m INNER JOIN m.conversation conversation LEFT JOIN MessageReading mr WITH mr.conversationId = m.conversation AND mr.user = :user WHERE (mr IS NULL OR m.id > mr.lastRead) AND m.conversation IN(5187, 5186, 5184, 5183, 5171, 5172, 5176, 5150, 5139, 5138) GROUP BY m.conversation

I get the following error:
Cannot add having condition on a non result variable

The change has been introduced by this commit
d9c1782 in 2.5.0

It was easily fixed by replacing WHERE (mr IS NULL by WHERE (mr.user IS NULL

Either my query was wrong but doctrine supported it when it was not supposed to be, or it's a break to may be worth mentioning in the upgrade file

Thank you

@fnagel
Copy link

fnagel commented Oct 26, 2016

Seems related to #5680

@pdrosos
Copy link

pdrosos commented Dec 19, 2016

Hi,

any news for this one? I need it and I can't use it in my query.

@beberlei
Copy link
Member

Fixed #6328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants