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

"Or" clause in a "where" condition returns a wrong result with not-found-ignore #3269

Closed
pasqualedante opened this issue Mar 24, 2023 · 3 comments

Comments

@pasqualedante
Copy link

pasqualedante commented Mar 24, 2023

I have updated NH from 5.2.6 to 5.4.1 and I found an important regression. I've read breaking-changes but can't find anything related. The bug is serious because it doesn't return the expected records. Let me explain better: I have a Customer class which exposes 2 properties of the same type (Agent): Agent1 and Agent2. Doing a where to see if there is an Agent1 with Id ='a' or an Agent2 with Id ='b', the query returns no results if m.NotFound(NotFoundMode.Ignore) is specified in the mapping. If you delete m.NotFound(NotFoundMode.Ignore) everything returns as before. Same result if I test for the same value Agent1.Id='a' Or Agent2.Id='a': again with m.NotFound(NotFoundMode.Ignore) does an inner join instead of a left join and nothing comes back. The last working version of NH is 5.2.7. Since 5.3 it doesn't work anymore.

I attach testcase.zip for fast review.

Maybe related to #1948?

@pasqualedante
Copy link
Author

hello @bahusoid thanks for the fix and sorry for the question: is the release of NH 5.4.2 expected soon? Otherwise in production environment I'm forced to revert to NH 5.2.6.

@bahusoid
Copy link
Member

Sorry no ETA for releases. It needs to be fixed in 5.3.x first.

@bahusoid
Copy link
Member

Fixed by #3270

@fredericDelaporte fredericDelaporte changed the title [Regression] Starting with NH 5.3, an or clause in a where condition return a wrong result if not-found-ignore is enabled "Or" clause in a "where" condition returns a wrong result with not-found-ignore Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants