-
Notifications
You must be signed in to change notification settings - Fork 934
Add more left join support #2737
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
Conversation
On master branch, this happens if you have kept somewhere a |
Aha, thanks! |
I updated the new visitor to use an instance of the old one to reduce the allocation.
I added a fix for the one that doesn't use the outer reference anywhere as it wasn't that complicated. |
src/NHibernate/Linq/GroupJoin/GroupJoinAggregateDetectionVisitor.cs
Outdated
Show resolved
Hide resolved
Thanks, @maca88 ! |
Hi @fredericDelaporte @bahusoid , I have the same problem with #2672 . This pull request says it has resolved the issue. When do you plan to merge this request? |
For some unknown reason, GitHub seems to have difficulties getting the TeamCity builds statuses. Checking manually on https://teamcity.jetbrains.com/, they have all succeeded for this PR. So, I consider forcing the merge for this PR. |
Fixes #2672
LINQ LeftJoin only works if the outer reference is projected in the query result, but it's perfectly feasible to only use it in e.g a where clause.
The new visitor could be merged a bit with the old one, in order to allocate a bit less, but I wanted to keep the old one as is for now, since it's used elsewhere. Perhaps the aggregated group joins should be investigated too.
I added two other failing test cases as well, marked with KnownBug. One which doesn't use the outer reference at all. Not a very likely query, since the join becomes irrelevant, but in query generation scenarios it could happen. I guess a visitor which purges the query model from unused left joins could do the trick.
The other test case runs a nested join. I think that could be rewritten to chain the nested joins, instead of nesting them.
Unfortunately, I wasn't able to run the async generator. "Failure scanning NAnt.NUnit2Tasks.dll for extensions"