Skip to content

TPH sibling metadata bug#29025

Merged
roji merged 1 commit intodotnet:release/7.0from
roji:TphSiblingMetadataBug
Sep 9, 2022
Merged

TPH sibling metadata bug#29025
roji merged 1 commit intodotnet:release/7.0from
roji:TphSiblingMetadataBug

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Sep 8, 2022

@AndriySvyryd, I think this small code change reproduces a bug in the relational model generation (this PR is based on top of #28908, so ignore the 1st commit).

Basically, when creating the sproc mappings (RelationalModel.CreateStoredProcedureMapping) for a TPH child, we filter out parameters which aren't mapped to the current child entity type. We'll add these to the StoredStoreProcedure later, but they'll be appended to the ended, meaning that the parameter longer is incorrect.

This is reproduced here by moving Child1Property to the end of the sproc parameter list, after some properties which belong to Child2. Inspecting the final metadata definition shows that in the StoredStoreProcedure, Child1Property comes before the Child2 properties instead of after (the conceptual StoreProcedure is fine).

(feel free to push fixes directly to this PR)

@roji roji requested a review from AndriySvyryd September 8, 2022 22:31
@roji roji force-pushed the TphSiblingMetadataBug branch from e42899d to 4919080 Compare September 9, 2022 11:01
@roji roji marked this pull request as ready for review September 9, 2022 11:02
@roji
Copy link
Copy Markdown
Member Author

roji commented Sep 9, 2022

Uhh, I can't approve this because it's my own PR, though the fix is actually Andriy's 🤣

@ajcvickers (or @AndriySvyryd) can you please approve?

@roji roji merged commit edae9ff into dotnet:release/7.0 Sep 9, 2022
@roji roji deleted the TphSiblingMetadataBug branch June 13, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants