Repository navigation
Preserve row value type mappings when rewriting expressions - #3953
Merged
Merged
Conversation
Fix tuple projections over query-filtered navigations losing their type mapping and failing during shaper compilation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4d1edc28-2b78-4a4a-8530-95424e486cad
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix has appropriate regression coverage and no identified blocking issues; tests were not executed.
0 open findings
What changed in this PR
Fixes #3933 by preserving PostgreSQL row-value type mappings during expression rewriting, preventing tuple-projection failures over query-filtered navigations.
Changes:
- Retains
TypeMappinginVisitChildren()andUpdate(). - Adds unit coverage for both rewrite paths and unchanged-expression identity.
- Adds synchronous and asynchronous regression coverage.
| File | Description |
|---|---|
| test/EFCore.PG.Tests/Query/PgRowValueExpressionTest.cs | Tests mapping preservation and expression identity. |
| test/EFCore.PG.FunctionalTests/Query/AdHocQueryFiltersQueryNpgsqlTest.cs | Tests tuple projections over filtered navigations. |
| src/EFCore.PG/Query/Expressions/Internal/PgRowValueExpression.cs | Preserves mappings when rebuilding row expressions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 14, 2026
roji
added a commit
that referenced
this pull request
Oct 14, 2026
) * [9.0] Preserve row value type mappings when rewriting expressions Backport #3953 to 9.0. Adapt the regression to EF 9 test APIs, nullable conventions, and query-filter parameter naming. (cherry picked from commit 8912932) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79a22b3a-d5f9-4921-ac7b-3a1b41a9adc1 * Configure tuple mapping locally for row value regression The global tuple mapping could be enabled after the query-filter test pool was already created, causing test-order-dependent tuple reads to fail. Configure it on the regression data source instead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79a22b3a-d5f9-4921-ac7b-3a1b41a9adc1 --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79a22b3a-d5f9-4921-ac7b-3a1b41a9adc1
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.
Tuple projections over query-filtered navigations can lose their type mapping during query rewriting, causing a
NullReferenceExceptionwhen the shaper is compiled.Preserve
TypeMappinginPgRowValueExpression.VisitChildren()andUpdate(). Adds synchronous/asynchronous regression coverage for the reported query, plus unit coverage for both rewrite paths and unchanged-expression identity.Fixes #3933