Repository navigation
Fix uncorrelated parameterized collections in compiled queries - #37372
Merged
Merged
Conversation
roji
force-pushed
the
CompiledQueriesUncorrelatedCollections
branch
2 times, most recently
from
December 15, 2025 11:27
9fe65de to
604c7dd
Compare
roji
marked this pull request as ready for review
December 15, 2025 11:27
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
AndriySvyryd
approved these changes
Dec 16, 2025
Contributor
There was a problem hiding this comment.
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 |
roji
force-pushed
the
CompiledQueriesUncorrelatedCollections
branch
from
December 27, 2025 08:39
604c7dd to
47f4138
Compare
Member
Author
|
Test failures unrelated, merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37370