Skip to content

WIP Fix nullable entity comparison with null #2612

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

Closed
wants to merge 3 commits into from

Conversation

bahusoid
Copy link
Member

Apparently fix made in #2081 wasn't enough as implicit joins were generated for comparisons like where entity.OneToOne is null. It should be left join instead...

Fixes #2611

@bahusoid bahusoid changed the title Fix nullable entity comparison with null WIP Fix nullable entity comparison with null Nov 23, 2020
joinIsNeeded = comparisonWithNullableEntity = true;

//TODO: Fix this hack. Ideally we should always left join here. Skip left join for nullable entity if query contains implicit joins. We currently don't support left joins for such queries (see OneToOneCompositeQueryCompareWithJoinOrIsNull)
var fromJoins = ASTUtil.CollectChildren<FromElement>(Walker.CurrentFromClause, x => x is FromElement fe && !fe.IsImplied && fe.Type == HqlSqlWalker.FROM_FRAGMENT);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So hacky... :( Not even sure it handles all the cases..

@fredericDelaporte
Copy link
Member

Is this fixing a regression, or fixing an additional case of an old issue which was only partially fixed? If that is the later, it would be better to target master.

@bahusoid
Copy link
Member Author

bahusoid commented Dec 29, 2020

It's fixing additional case... And I don't like this fix at all.. So will close it now. Needs some thinking when I have time..

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

Successfully merging this pull request may close these issues.

2 participants