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] InMemory: Wrap composite key selector for owned type in AnonymousObject #23732

Merged
merged 2 commits into from
Jan 13, 2021

Conversation

smitpatel
Copy link
Contributor

@smitpatel smitpatel commented Dec 18, 2020

Resolves #23687

Composite key selector needs wrapper so that we compare them component-wise

Description

When generating server side join for InMemory, we need to use Join from enumerable which takes key selectors for outer/inner. For composite key we generate an array of object where each index contain the property value. In order to compare them correctly during key selector we need to wrap them in AnonymousObject so that we compare matching indexes in both arrays. When we removed Anonymous object from core, we removed automatic injection of it in key selector generation hence queries with composite keys for owned reference failed to compare correctly.

Customer Impact

Queries where owned reference has composite key to owner will fail to match during join causing incorrect results to be generated in InMemory provider.

How found

Customer reported on 5.0.1.

Test coverage

We have added test coverage in this PR.

Regression?

Yes, from 3.1

Risk

Low. Only affects the faulty code path. Also added quirk to revert to earlier behavior.

Resolves #23687

Composite key selector needs wrapper so that we compare them component-wise
@smitpatel smitpatel requested a review from a team December 18, 2020 21:15
@ajcvickers ajcvickers added this to the 5.0.x milestone Dec 18, 2020
@ajcvickers
Copy link
Member

Approved by Tactics for 5.0.3; please wait for the branch to open before merging.

@wtgodbe wtgodbe merged commit 39c48e0 into release/5.0 Jan 13, 2021
@wtgodbe wtgodbe deleted the smit/MyPrecious branch January 13, 2021 17:17
@ajcvickers ajcvickers removed this from the 5.0.3 milestone Jan 14, 2021
@ajcvickers ajcvickers modified the milestone: 5.0.x 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.

5 participants