Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPH sibling metadata bug #29025

Merged
merged 1 commit into from
Sep 9, 2022
Merged

Conversation

roji
Copy link
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 marked this pull request as ready for review September 9, 2022 11:02
@roji
Copy link
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
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