-
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: Subquery.contains generates invalid SQL #7666
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
Could you post the SQL that is getting sent to the database? |
@rowanmiller SELECT [m].[Id], [m].[Name]
FROM [Posts] AS [m]
WHERE [m].[Id] IN (
SELECT [m.Tag].[PostId] -- Expects [m.Tag].[Id] instead of [m.Tag].[PostId]
FROM [PostsTags] AS [m1]
INNER JOIN [Tags] AS [m.Tag] ON [m1].[TagId] = [m.Tag].[Id]
WHERE [m.Tag].[Name] = N'www'
) Expected: SELECT [m].[Id], [m].[Name]
FROM [Posts] AS [m]
WHERE [m].[Id] IN (
SELECT [m.Tag].[Id]
FROM [PostsTags] AS [m1]
INNER JOIN [Tags] AS [m.Tag] ON [m1].[TagId] = [m.Tag].[Id]
WHERE [m.Tag].[Name] = N'www'
) |
Shouldn't expected be SELECT [m].[Id], [m].[Name]
FROM [Posts] AS [m]
WHERE [m].[Id] IN (
SELECT [m1].[PostId]
FROM [PostsTags] AS [m1]
INNER JOIN [Tags] AS [m.Tag] ON [m1].[TagId] = [m.Tag].[Id]
WHERE [m.Tag].[Name] = N'www'
) |
@smitpatel You are right. Thanks for correcting me. |
#7691 fixes this. 😌 |
smitpatel
added a commit
that referenced
this issue
Feb 24, 2017
smitpatel
added a commit
that referenced
this issue
Feb 24, 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
Exception:
System.Data.SqlClient.SqlException: Invalid column name 'PostId'.
Steps to reproduce
Further technical details
EF Core version: 1.1.0
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2015
The text was updated successfully, but these errors were encountered: