-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
TryRewriteEntityEquality and NotEqual comparison of CompositePrimaryKey #23779
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
Milestone
Comments
it indeed is a bug which results in data corruption - possible candidate for patch? @ajcvickers |
maumar
added a commit
that referenced
this issue
Jan 5, 2021
…ompositePrimaryKey When comparing composite key entities we were comparing the constituent keys and combining them with AndAlso. For not equal comparison we were still comparing the keys using !=, but we didn't flip the combining operator to OrElse. Fixes #23779
maumar
added a commit
that referenced
this issue
Jan 5, 2021
…ompositePrimaryKey When comparing composite key entities we were comparing the constituent keys and combining them with AndAlso. For not equal comparison we were still comparing the keys using !=, but we didn't flip the combining operator to OrElse. Fixes #23779
maumar
added a commit
that referenced
this issue
Jan 9, 2021
…ompositePrimaryKey When comparing composite key entities we were comparing the constituent keys and combining them with AndAlso. For not equal comparison we were still comparing the keys using !=, but we didn't flip the combining operator to OrElse. Fixes #23779
maumar
added a commit
that referenced
this issue
Jan 13, 2021
…ompositePrimaryKey When comparing composite key entities we were comparing the constituent keys and combining them with AndAlso. For not equal comparison we were still comparing the keys using !=, but we didn't flip the combining operator to OrElse. Fixes #23779
This was referenced Mar 6, 2021
This was referenced Mar 15, 2021
Closed
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
I not sure, but seems this code has mistake:
efcore/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitor.cs
Lines 1397 to 1409 in 03c1ba5
In case of obj1.CompositePK != obj2.CompositePK need generate SQL with OR:
NOT(obj1.CompositePK.part1==obj2.CompositePK.part1) OR NOT(obj1.CompositePK.part2==obj2.CompositePK.part2)
Your code generates SQL with AND:
NOT(obj1.CompositePK.part1==obj2.CompositePK.part1) AND NOT(obj1.CompositePK.part2==obj2.CompositePK.part2)
?
The text was updated successfully, but these errors were encountered: