Skip to content

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

@roji

Description

@roji

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.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions