Skip to content

[release/11.0] Preserve inherited complex-property column prefixes in TPC mappings - #39270

Merged
AndriySvyryd merged 5 commits into
release/11.0from
copilot/fix-tpc-properties-prefix-issue
Oct 20, 2026
Merged

AndriySvyryd merged 5 commits into
release/11.0from
copilot/fix-tpc-properties-prefix-issue

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #39244

Description
This fix applies inherited complex-property prefixes in TPC leaf tables and views, including nested paths to avoid name collisions:
Shipping.Zip → Shipping_Zip, Billing.Zip → Billing_Zip.

Customer impact
Name collisions could silently cause existing values to be read as another property's data when adding a same-typed property. Explicit column names are a workaround. Making this fix after GA would be a breaking change for users already on GA.

How found
Customer-reported on 11.0-rc1

Regression
No. The support for this mapping is new in 11.0

Testing
Tests added.

Risk
Low, limited to relational column names for inherited complex properties in TPC.

Copilot AI changed the title [WIP] Fix TPC columns of complex property prefix issue Preserve inherited complex-property column prefixes in TPC mappings Oct 16, 2026
Copilot AI requested a review from AndriySvyryd October 16, 2026 01:18
@AndriySvyryd
AndriySvyryd requested a balanced review from Copilot October 16, 2026 17:46
@AndriySvyryd AndriySvyryd changed the title Preserve inherited complex-property column prefixes in TPC mappings [release/11.0] Preserve inherited complex-property column prefixes in TPC mappings Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrowly scoped fix addresses the reported defect with focused regression coverage and no identified blocking issues.

0 open findings

What changed in this PR

Fixes #39244 by preserving inherited complex-property column prefixes in EF Core’s TPC mappings, preventing column reassignment when another complex property is added.

Changes:

  • Preserve full nested prefixes in derived tables and views.
  • Add mapping and migration regression coverage.
  • Update SQL Server query baselines.
File Description
test/​EFCore.SqlServer.FunctionalTests/​Query/​Inheritance/​TPCInheritanceTableSplittingQuerySqlServerTest.cs Update complex-property SQL baselines.
test/​EFCore.SqlServer.FunctionalTests/​Query/​Inheritance/​TPCInheritanceQuerySqlServerTestBase.cs Update inherited-column SQL baselines.
test/​EFCore.Relational.Tests/​Migrations/​Internal/​MigrationsModelDifferTest.cs Verify adding a property preserves existing columns.
test/​EFCore.Relational.Tests/​Metadata/​RelationalModelTest.cs Cover nested prefixes, repeated types, and abstract/concrete roots.
src/​EFCore.Relational/​Extensions/​RelationalPropertyExtensions.cs Apply prefixes to TPC derived store objects.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI requested a review from AndriySvyryd October 16, 2026 18:00
@AndriySvyryd
AndriySvyryd marked this pull request as ready for review October 16, 2026 19:20
@AndriySvyryd
AndriySvyryd requested a review from a team as a code owner October 16, 2026 19:20
@AndriySvyryd
AndriySvyryd requested review from artl93 and cincuranet and a balanced review from Copilot October 16, 2026 19:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review identified no blocking issues in the localized fix and regression coverage; tests were not executed.

0 open findings

🧠 Review effort: Balanced

@github-code-quality

github-code-quality Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: C#

C# / code-coverage

release/11.0 2e88827 copilot/fix-tpc-prop... b35da50 +/-
76% 67% -9%
View coverage of the 10 most impacted files.
File release/11.0 2e88827 copilot/fix-tpc-prop... b35da50 +/-
/Users/runner/w...nal/Snapshot.cs 0% 60% +60%
D:\a\efcore\efc...nal\Snapshot.cs 0% 64% +64%
/home/runner/wo...nal/Snapshot.cs 0% 66% +66%
/home/runner/wo...yTypeBuilder.cs 0% 88% +88%
D:\a\efcore\efc...yTypeBuilder.cs 0% 88% +88%
/Users/runner/w...ngs.Designer.cs 0% 92% +92%
/home/runner/wo...ctExpression.cs 0% 93% +93%
D:\a\efcore\efc...ctExpression.cs 0% 93% +93%
D:\a\efcore\efc...ngs.Designer.cs 0% 94% +94%
/home/runner/wo...ngs.Designer.cs 0% 95% +95%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 16, 2026 22:25 UTC

Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:16
Copilot AI requested a review from AndriySvyryd October 16, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The corresponding SQLite SQL baseline still expects unprefixed columns and needs updating.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 16, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow naming correction has targeted regression coverage and consistent provider baselines, with no unresolved findings.

1 open issue

Review effort: Balanced

@artl93 artl93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New feature in 11.0. Customer reported. Approved.

@AndriySvyryd
AndriySvyryd merged commit 68d9f6c into release/11.0 Oct 20, 2026
21 checks passed
@AndriySvyryd
AndriySvyryd deleted the copilot/fix-tpc-properties-prefix-issue branch October 20, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TPC: columns of a complex property inherited by a leaf table lose the complex property prefix, and adding a second one of the same type swaps the data

5 participants