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

Handle binary keys of different lengths in update pipeline #16970

Merged
merged 1 commit into from Aug 6, 2019

Conversation

ajcvickers
Copy link
Member

Fixes #16888

Note that StructuralEqualityComparer.Equals does not suffer from this problem.

Fixes #16888

Note that `StructuralEqualityComparer.Equals` does not suffer from this problem.
@ajcvickers ajcvickers merged commit 4561939 into release/3.0 Aug 6, 2019
@ghost ghost deleted the ThatOneLooksSmallerToMe0805 branch August 6, 2019 17:44
@jjxtra
Copy link

jjxtra commented Aug 6, 2019

Possible issue: It looks like the commit is comparing byte array lengths, this may not be correct. You need to compare bytes still, but if the smaller byte array is equal to the larger array up to it's length (like a substring), then it is less than the larger byte array, otherwise if the smaller byte array has a byte greater than the larger byte array at the same index, it is greater than.

Of course I could be misunderstanding something...

@ajcvickers
Copy link
Member Author

@jjxtra All we need is a consistent ordering. What functional issue would it fix to do what you suggest?

@jjxtra
Copy link

jjxtra commented Aug 6, 2019

I don’t know enough about the guts of entity framework to know. Just raising a possible problem...

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

Successfully merging this pull request may close these issues.

Error comparing byte array of different size in primary key with Add or Update then SaveChanges
3 participants