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] Visit arguments in QueryableMethodNormalizingExpressionVisitor after converting List.Contains (#32219) #32266

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

roji
Copy link
Member

@roji roji commented Nov 9, 2023

Fixes #32215 and #32218, backports #32219

(cherry picked from commit 08ee676)

Description

  1. When converting List.Contains() to Queryable.Contains() in preprocessing, QueryableMethodNormalizingExpressionVisitor does not visit into the instance/arguments of the expressions. As a result, normalization does not happen recursively.
  2. When identifying Contains for legacy pre-8.0-style translation (expansion of parameter list to constants in SQL), if AsQueryable() as composed over the parameter list, the construct isn't identified and translation fails.

The two bugs are fixed in the same PR as fixing the 1st exposes the 2nd.

Customer impact

The 1st bug can affect any LINQ query containins List.Contains(); if either the instance or the argument requires normalization, that normalization won't occur and query translation will likely fail. This can affect an unknown number of queries.

How found

Customer reported on 8.0

Regression

Yes.

Testing

Added tests.

Risk

Very low; separate quirks for both bugs have been added.

@roji roji merged commit 7c8127b into dotnet:release/8.0 Nov 13, 2023
7 checks passed
@roji roji deleted the OtherContainsFixes8.0 branch November 13, 2023 13:58
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.

None yet

3 participants