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

[5.0.3] Fix to #23779 - TryRewriteEntityEquality and NotEqual comparison of CompositePrimaryKey #23836

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Jan 9, 2021

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 maumar requested a review from smitpatel January 9, 2021 00:49
@maumar maumar changed the title Fix to #23779 - TryRewriteEntityEquality and NotEqual comparison of CompositePrimaryKey [5.0.3] Fix to #23779 - TryRewriteEntityEquality and NotEqual comparison of CompositePrimaryKey Jan 9, 2021
@maumar
Copy link
Contributor Author

maumar commented Jan 9, 2021

Description

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.

Customer Impact

Data corruption. Queries which compare two entities which have composite key may result incorrect results.

How found

Customer reported on 5.0.1.

Test coverage

We have added test coverage in this PR.

Regression?

No, this scenario was not supported in previous versions.

Risk

Low. Fix only affects one codepath (per provider) which involves flipping binary operation from AndAlso to OrElse for one particular scenario - comparing two entities with composite keys. Also added quirk to revert to earlier behavior.

@ajcvickers ajcvickers added this to the 5.0.x milestone Jan 11, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.3 Jan 12, 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 maumar merged commit 84227cd into release/5.0 Jan 13, 2021
@maumar maumar deleted the fix23779_50 branch January 13, 2021 06:18
@ajcvickers ajcvickers removed this from the 5.0.3 milestone Jan 14, 2021
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.

4 participants