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

Ignore hidden columns (used in SQL Server system versioned tables) #8276

Closed
wants to merge 1 commit into from

Conversation

ErikEJ
Copy link
Contributor

@ErikEJ ErikEJ commented Apr 25, 2017

fixes #8192

Copy link
Contributor

@lajones lajones left a comment

Choose a reason for hiding this comment

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

Thanks very much, @ErikEJ. In general it looks great. Just a few small comments.

[SqlServerCondition(SqlServerCondition.SupportsSequences)]
public void Hidden_Column()
{
using (var scratch = SqlServerTestStore.Create("SqlServerE2E"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I would rename the DB to be something more easily tracked to this test e.g. HiddenColumnTest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do!

, SysStartTime datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL
, SysEndTime datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL
, PERIOD FOR SYSTEM_TIME(SysStartTime, SysEndTime)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Personally I like the "comma at the beginning of the line" convention, but as a team we decided to put them at the end of the previous line instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move the commas 😄

@@ -351,6 +351,60 @@ PRIMARY KEY (Id)
}
}

[ConditionalFact]
[SqlServerCondition(SqlServerCondition.SupportsSequences)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this condition just happen to coincide? Or are supporting sequences and supporting hidden columns different things? I'm wondering whether we should create a new condition SqlServerCondition.SupportsHiddenColumns?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should create condition for SqlServer 2016

Copy link
Contributor

Choose a reason for hiding this comment

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

@smitpatel I don't think this is just a SQL Server 2016 issue. See bug #5553 about supporting sequences in SQL Azure as well. This could be similar, so I would prefer to keep the flag named for the function, not the version of SQL Server.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add a new condition - #5553 is getting moot, as Azure DB v11 is being deprecated

Copy link
Contributor

Choose a reason for hiding this comment

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

Preferable thing is to have flag based on the function. I mistakenly thought that we may end up with multiple conditions. Instead of having a large set of conditions to specify its good to have only one. But we won't hit such issue because this conditions are +ve. Means specify the one which needs to be present.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Apr 26, 2017

@lajones I noticed the build failed, as the NuGet v2 api had some issues earlier - maybe you can remove the lookup for v2 feed during build, and only use v3 feed?

@lajones
Copy link
Contributor

lajones commented Apr 26, 2017

Sorry, @ErikEJ, because we have a new flag we also need to update the config.json file to have "SupportsHiddenColumns": true.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Apr 26, 2017

@lajones Done

@@ -5,7 +5,8 @@
"ElasticPoolName": "",
"SupportsSequences": true,
"SupportsOffset": true,
"SupportsMemoryOptimized": false
"SupportsMemoryOptimized": false,
"SupportsHiddenColumns": true
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be false as MemoryOptimized? This is our default connection string for testing and we still use SqlServer2014 which does not support hidden columns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am confused now - so you use 2016 on the CI (appveyor) and 2014 on what ?? (your dev pcs) - in that case it should be false, yes (it has no impact on the functional tests, though)

Copy link
Contributor

Choose a reason for hiding this comment

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

@ErikEJ - Did not realize this confusion 😄 Minimum requirement to build EF repo is SqlServer 2014 (or it could run with older version too may be).
We use SqlServer 2016 in appveyor because appveyor was failing to start sqlserver 2014 service and build failed always providing no feedback.
The normal dev work is on sql server 2014 as of now.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ErikEJ @smitpatel Smit is right. I was thinking this was like SupportsSequences, but it's more like SupportsMemoryOptimized and so should be false by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the meantime - I have run this test on my dev machine (which has SQL Server 2016) and it works fine.

Copy link
Contributor

@lajones lajones left a comment

Choose a reason for hiding this comment

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

I'm good with this being checked in once the change to SupportsHiddenColumns being false is done.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Apr 27, 2017

@lajones Thanks! I have updated the config.json file to match your test and dev environment

@lajones
Copy link
Contributor

lajones commented Apr 27, 2017

@ErikEJ Looks good. Could you squash all the commits together please and I can check it in for you? Thx.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Apr 27, 2017

@lajones Done

@lajones
Copy link
Contributor

lajones commented Apr 27, 2017

Checked in with commit 3647f57. Thanks very much, @ErikEJ.

@lajones lajones closed this Apr 27, 2017
@lajones lajones added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 27, 2017
@lajones lajones added this to the 2.0.0-preview1 milestone Apr 27, 2017
@ajcvickers ajcvickers removed this from the 2.0.0-preview1 milestone Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants