Skip to content

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

@pasqualedante

Description

@pasqualedante

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions