-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Fix uncorrelated parameterized collections in compiled queries #37372
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
Conversation
9fe65de to
604c7dd
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes issue #37370 by properly handling uncorrelated parameterized collections in compiled queries. When a parameter collection is used in a query without any operation that provides type inference (e.g., comparison to a column), the code now falls back to applying the default type mapping instead of failing.
Key changes:
- Modified type mapping postprocessors to handle collections without inferred type mappings by applying default mappings
- Added test coverage for compiled queries with uncorrelated parameter collection expressions across all database providers
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/EFCore.Relational/Query/RelationalTypeMappingPostprocessor.cs |
Added fallback logic to apply default type mapping when no inferred element type mapping exists for VALUES expressions |
src/EFCore.SqlServer/Query/Internal/SqlServerTypeMappingPostprocessor.cs |
Added fallback logic to apply default type mapping when no inferred element type mapping exists for OPENJSON expressions |
test/EFCore.Specification.Tests/Query/PrimitiveCollectionsQueryTestBase.cs |
Added base test for compiled queries with uncorrelated parameter collection expressions |
test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs |
Added SQLite-specific test override with SQL assertion |
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQuerySqlServerTest.cs |
Added SQL Server-specific test override with SQL assertion |
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQuerySqlServerJsonTypeTest.cs |
Added SQL Server JSON type-specific test override with SQL assertion |
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQuerySqlServer160Test.cs |
Added SQL Server 2016-specific test override with SQL assertion |
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQueryOldSqlServerTest.cs |
Added older SQL Server version-specific test override with SQL assertion |
test/EFCore.Cosmos.FunctionalTests/Query/PrimitiveCollectionsQueryCosmosTest.cs |
Added Cosmos DB-specific test override with SQL assertion |
src/EFCore.SqlServer/Query/Internal/SqlServerTypeMappingPostprocessor.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Query/Internal/SqlServerTypeMappingPostprocessor.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Relational/Query/RelationalTypeMappingPostprocessor.cs
Outdated
Show resolved
Hide resolved
604c7dd to
47f4138
Compare
|
Test failures unrelated, merging. |
Fixes #37370