-
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
Query: .Where() ignored before .DefaultIfEmpty() (LEFT JOIN) #7080
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
Comments
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 4, 2017
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 6, 2017
…ated SQL - Resolves dotnet#2341 - Resolves dotnet#5085 - Resolves dotnet#5230 - Resolves dotnet#6618 - Resolves dotnet#6647 - Resolves dotnet#6782 - Resolves dotnet#7080 - Resolves dotnet#7220 - Resolves dotnet#7417 - Resolves dotnet#7497 - Resolves dotnet#7523 - Resolves dotnet#7525
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 6, 2017
…ated SQL - Resolves dotnet#2341 - Resolves dotnet#5085 - Resolves dotnet#5230 - Resolves dotnet#6618 - Resolves dotnet#6647 - Resolves dotnet#6782 - Resolves dotnet#7080 - Resolves dotnet#7220 - Resolves dotnet#7417 - Resolves dotnet#7497 - Resolves dotnet#7523 - Resolves dotnet#7525
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 6, 2017
…ated SQL - Resolves dotnet#2341 - Resolves dotnet#5085 - Resolves dotnet#6618 - Resolves dotnet#6647 - Resolves dotnet#6782 - Resolves dotnet#7080 - Resolves dotnet#7220 - Resolves dotnet#7417 - Resolves dotnet#7497 - Resolves dotnet#7523 - Resolves dotnet#7525
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 6, 2017
…ated SQL - Resolves dotnet#2341 - Resolves dotnet#5085 - Resolves dotnet#6618 - Resolves dotnet#6647 - Resolves dotnet#6782 - Resolves dotnet#7080 - Resolves dotnet#7220 - Resolves dotnet#7417 - Resolves dotnet#7497 - Resolves dotnet#7523 - Resolves dotnet#7525
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 7, 2017
…ated SQL - Resolves dotnet#2341 - Resolves dotnet#5085 - Resolves dotnet#6618 - Resolves dotnet#6647 - Resolves dotnet#6782 - Resolves dotnet#7080 - Resolves dotnet#7220 - Resolves dotnet#7417 - Resolves dotnet#7497 - Resolves dotnet#7523 - Resolves dotnet#7525
tuespetre
added a commit
to tuespetre/EntityFramework
that referenced
this issue
Feb 9, 2017
…ated SQL - Resolves dotnet#2341 - Resolves dotnet#5085 - Resolves dotnet#6618 - Resolves dotnet#6647 - Resolves dotnet#6782 - Resolves dotnet#7080 - Resolves dotnet#7220 - Resolves dotnet#7417 - Resolves dotnet#7497 - Resolves dotnet#7523 - Resolves dotnet#7525
4 tasks
This scenario indeed works on the current bits. We produce the following SQL (give or take, the model might not be exactly the same, as I reverse engineered it from the query):
|
maumar
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Apr 15, 2017
ajcvickers
changed the title
.Where() ignored before .DefaultIfEmpty() (LEFT JOIN)
Query: .Where() ignored before .DefaultIfEmpty() (LEFT JOIN)
May 9, 2017
divega
added
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
and removed
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
labels
May 10, 2017
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.
type-bug
Steps to reproduce
The following LINQ Query (to SQL) does not generate the correct SQL statement:
The issue
Specifically, the .Where(x => x.UserId == 2) condition is not applied to the LEFT JOIN result in the generated SQL statement, and causes incorrect results to be returned.
Expected behavior (from LINQPad 5)
Incorrect Observed behavior (current version 1.1.0) (from SQL Profiler)
Currently observed runtime behavior generates the following SQL:
It is clear that the condition on the LEFT JOIN is omitted in this query, and instead I expected to see
LEFT JOIN [ProjectSprintUser] AS [psu] ON [psu].UserId = 2 AND [ps].[Id] = [psu].[ProjectSprintId]
Previous behavior (version 1.0.1) (from SQL Profiler)
Previously this generated three different queries, and then presumably combines the result internally:
Further technical details
EF Core version: (1.1.0)
Operating system: Windows 10 / Windows Server 2016
Visual Studio version: (VS 2015 Update 3, .NET Core Runtime 1.1.0)
The text was updated successfully, but these errors were encountered: