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

SqlServer: Generate False predicate when skip/take both are 0 #23192

Merged
1 commit merged into from
Nov 5, 2020

Conversation

smitpatel
Copy link
Member

Resolves #22525

@smitpatel smitpatel requested a review from a team November 4, 2020 21:29
@ghost
Copy link

ghost commented Nov 4, 2020

Hello @smitpatel!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@@ -3152,12 +3154,12 @@ private bool Equals(SelectExpression selectExpression)
/// <returns> This expression if no children changed, or an expression with the updated children. </returns>
// This does not take internal states since when using this method SelectExpression should be finalized
public SelectExpression Update(
[NotNull] List<ProjectionExpression> projections,
[NotNull] List<TableExpressionBase> tables,
[NotNull] IReadOnlyList<ProjectionExpression> projections,
Copy link
Member

Choose a reason for hiding this comment

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

Breaking change, including in obsolete method above?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not breaking change if you follow the bases.

Copy link
Member Author

Choose a reason for hiding this comment

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

@AndriySvyryd - Is this breaking change? Not sure how this missed API review.
For the obsolete one, it added additional NotNulls but the overload is already obsolete, not sure what would be the way to unbreak it.

Copy link
Member

Choose a reason for hiding this comment

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

The type change is indeed only a provider-facing binary breaking change only, which should be fine. But if this method used to work for null parameters and doesn't any more, that is more problematic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not this method. This method was always marked with NotNull and has Check.NotNull for all the non-nullable arguments.

@@ -2326,6 +2327,35 @@ public virtual Task GroupBy_aggregate_join_another_GroupBy_aggregate(bool async)
elementSorter: o => o.Key);
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupBy_aggregate_after_skip_0_take_0(bool async)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure, but as this is a SQL Server problem, should these tests live exclusively in the SQL Server test suite?

Copy link
Member Author

Choose a reason for hiding this comment

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

If it works in other providers then what is the issue verifying that?

Copy link
Member

Choose a reason for hiding this comment

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

Just the fact of adding unnecessary tests to all providers for something that is only a problem for one. I have a lot of PG-only tests which aren't added to the base classes only because EFCore.PG isn't in the EF Core repo, and SQL Server is.

It's also a form of documentation for someone reviewing the tests, to note which provider is actually affected by it etc. Just putting it in the right place.

But no strong feelings here.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

LGTM apart from the nullability change which we should decide on

@ghost ghost merged commit 7607893 into main Nov 5, 2020
@ghost ghost deleted the smit/Skip0Take0 branch November 5, 2020 07:48
@roji
Copy link
Member

roji commented Nov 5, 2020

Oops, forgot to remove auto-merge :/ If needed we can discuss/amend post-merge.

This pull request was closed.
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.

.Take(0) after .Skip causes an SqlException on SQL Server
2 participants