-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Don't add grouping key to projection when Distinct is applied #28039
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
Milestone
Comments
smitpatel
added a commit
that referenced
this issue
May 20, 2022
smitpatel
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
May 20, 2022
ghost
pushed a commit
that referenced
this issue
May 24, 2022
Thanks for the quick resolution. Will this be part of 6.0.6? |
Re-open to discuss patching. |
Note from triage: we will prepare a 6.0 patch for this. |
smitpatel
added a commit
that referenced
this issue
Jun 1, 2022
ajcvickers
changed the title
Incorrect SQL Generated
Don't add grouping key to projection when Distinct is applied
Jul 21, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
Servicing-approved
type-bug
Background
I am upgrading my solution from .NET 5.0.13 to .NET 6.0.5. However, I'm blocked by incorrectly generated SQL that i have been unable to find a workaround for.
I have checked numerous open and closed cases and have not found something that matches my problem.
Problem
-- NET 5.0.13 generated code
-- NET 6.0.1 and 6.0.5 generated code
For clarity, [i].[RowId] should not be in the generated SQL.
Cause
The above SQL is being generated by this code:
If queryResults is converted to a list such as:
Sample
I have attached a simple repro project
PP.Core6.SqlBug1.zip
Include provider and version information
EF Core version: 6.0.1 and 6.0.5
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system: Windows 11
IDE: Visual Studio 2022 17.1.6
Thank you!
The text was updated successfully, but these errors were encountered: