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

[release/8.0] Fix parameter names for nested types in complex type equality (#33527) #33548

Merged
merged 2 commits into from
May 1, 2024

Conversation

roji
Copy link
Member

@roji roji commented Apr 16, 2024

Fixes #33449
Backport of #33527

Description
When translating the equality comparison of two complex types, EF generates SQL to compare every property of the complex type to each other; when one of these complex type is a client-side parameter, EF constructs a new, synthetic parameter for each such property - recursively. However, the synthetic parameter names contained the name of the parameter and the name of the final (non-complex property), but did not contain the names of intermediate nested complex types containing the property. As a result, if a complex type contains two properties with the same name within different nested complex types, the same parameter name is generated and the old parameter is overridden.

Customer impact
When doing complex type comparison against a parameter, where multiple nested properties have the same name, an incorrect query is generated, leading either to an error or two data corruption (incorrect results being returned).

How found
Customer reported on 8.

Regression
No, complex type support is a new feature in EF8.

Testing
Test added.

Risk
Very Low. The fix is very localized and straightforward - we simply add nested property names when constructing the parameter name. A quirk was added just in case.

@roji roji requested a review from a team April 16, 2024 15:24
@SamMonoRT
Copy link
Member

@roji @maumar - removing the "Servicing-consider" label till we investigate the CI failures. Please add it back once we are all clear.

@roji
Copy link
Member Author

roji commented Apr 17, 2024

@maumar thanks for pushing a fix to this! Putting back servicing-consider.

@SamMonoRT
Copy link
Member

Approved via email.

@SamMonoRT SamMonoRT added this to the 8.0.x milestone Apr 17, 2024
@maumar maumar modified the milestones: 8.0.x, 8.0.6 Apr 17, 2024
@maumar maumar merged commit ea5724d into dotnet:release/8.0 May 1, 2024
7 checks passed
@ajcvickers ajcvickers modified the milestones: 8.0.6, 8.0.7 Jun 3, 2024
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