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

Table Splitting Discriminator property should be nullable by default #21612

Closed
MaxG117 opened this issue Jul 14, 2020 · 0 comments · Fixed by #21724
Closed

Table Splitting Discriminator property should be nullable by default #21612

MaxG117 opened this issue Jul 14, 2020 · 0 comments · Fixed by #21724
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@MaxG117
Copy link

MaxG117 commented Jul 14, 2020

I ran into a problem while validating Can_manipulate_entities_sharing_row_independently in TableSplittingTestBase. The test attempts to remove one of the entities ("Engine") from a shared table ("Vehicles"), which really just sets two columns ("Description" and "Engine_Discriminator") to NULL. This fails with our ADO.NET provider, because the DbParameter.Value for the discriminator column is DbNull.Value, but DbParameter.IsNullable is false.

If I'm understanding the Table Splitting feature correctly, the discriminator properties should all be nullable by default. The TypeMappedRelationalParameter.AddParameter implementation creates a new instance of the relational parameter, which inherits IsNullable from property.IsNullable. Eventually this becomes a provider-specific implementation of DbParameter with IsNullable=false.

Please confirm if this is a bug in EF Core, or perhaps in the Functional Test (the Metadata.IsNullable could be set to true for the discriminator), or if I'm mistaken in my understanding of the feature.

Further technical details

EF Core version: 3.1.5
Database provider: the one I'm writing

@AndriySvyryd AndriySvyryd self-assigned this Jul 21, 2020
@AndriySvyryd AndriySvyryd added this to the 5.0.0 milestone Jul 22, 2020
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 22, 2020
@AndriySvyryd AndriySvyryd removed their assignment Jul 22, 2020
@ghost ghost closed this as completed in #21724 Jul 23, 2020
ghost pushed a commit that referenced this issue Jul 23, 2020
…able splitting (#21724)

* Configure command parameters as nullable for optional dependents in table splitting

Fixes #21612

* Obsolete more members on TypeMaterializationInfo
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-rc1 Aug 14, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-rc1, 5.0.0 Nov 7, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants