Repository navigation
Fix SQL Server split-query projections of primitive JSON collections - #39294
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Agent harness evaluation deferredThis PR affects: |
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The localized fix has targeted regression coverage and no identified blocking defects; database-backed tests were not executed.
No open issues 🎉
What changed in this PR
Fixes SQL Server split-query projections of primitive JSON collections by correcting type mappings in the OPENJSON rewrite.
Changes:
- Initializes raw JSON mappings before use and preserves element converters.
- Adds synchronous/asynchronous regressions and provider-specific assertions.
- Documents the mapping invariant in query-pipeline guidance.
| File | Description |
|---|---|
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQuerySqlServerTest.cs |
Adds SQL Server baselines. |
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQuerySqlServerJsonTypeTest.cs |
Adds native JSON baselines. |
test/EFCore.SqlServer.FunctionalTests/Query/PrimitiveCollectionsQueryOldSqlServerTest.cs |
Covers older compatibility behavior. |
test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs |
Asserts SQLite’s APPLY limitation. |
test/EFCore.Relational.Specification.Tests/Query/PrimitiveCollectionsQueryRelationalTestBase.cs |
Adds shared string and converter regressions. |
src/EFCore.SqlServer/Query/Internal/SqlServerJsonPostprocessor.cs |
Initializes and preserves required mappings. |
.agents/skills/query-pipeline/SKILL.md |
Documents mapping preservation requirements. |
Review effort: Balanced
Code coverage overviewLanguages: C# C# / code-coverage
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
Projecting a JSON-mapped primitive collection through an identity
SelectwithAsSplitQuerycan throwNullReferenceException. TheOPENJSONordering rewrite can create a value column before its type mapping is initialized.nvarchar(max)mapping before use.APPLYlimitation.