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

Contains fallback translation fails when the array parameter has AsQueryable #32218

Closed
roji opened this issue Nov 2, 2023 · 2 comments · Fixed by #32219
Closed

Contains fallback translation fails when the array parameter has AsQueryable #32218

roji opened this issue Nov 2, 2023 · 2 comments · Fixed by #32219
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. Servicing-approved type-bug
Milestone

Comments

@roji
Copy link
Member

roji commented Nov 2, 2023

In the legacy translation mode for Contains with an array parameter source (e.g. for old SQL Server), our pattern matching fails when the parameter source is wrapped by AsQueryable. For normal cases, AsQueryable is removed by nav expansion as it's unnecessary (ParameterQueryRootExpression is already queryable); but there are certain cases where nav expansion does not visit (e.g. nested Contains, see #32217 for the full details).

As a workaround suitable for patching 8.0, we can simply recognize and unwrap AsQueryable in the Contains fallback logic.

@roji roji self-assigned this Nov 2, 2023
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 2, 2023
roji added a commit to roji/efcore that referenced this issue Nov 2, 2023
roji added a commit to roji/efcore that referenced this issue Nov 3, 2023
roji added a commit that referenced this issue Nov 3, 2023
@ajcvickers ajcvickers reopened this Nov 8, 2023
roji added a commit to roji/efcore that referenced this issue Nov 9, 2023
@roji
Copy link
Member Author

roji commented Nov 9, 2023

@ajcvickers this got fixed by the same PR (#32219) as #32215; I fixed both in a single PR since fixing #32215 caused failures requiring this issue to be fixed as well.

@ajcvickers
Copy link
Member

@roji Sounds good. Let's leave them both open for now, and then close them both if/when the single PR is approved and merged for servicing.

roji added a commit to roji/efcore that referenced this issue Nov 13, 2023
@ajcvickers ajcvickers added this to the 8.0.1 milestone Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. Servicing-approved type-bug
Projects
None yet
2 participants