-
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
EF.Functions.Contains(...) and nested queries #20084
Comments
@alienwareone Please attach a small, runnable project or post a complete, runnable code listing that reproduces the behavior you are seeing so that we can investigate. |
Note for team: I can repro this. When the property is not on an owned type, then we generate this: SELECT [p].[Id], [p].[SearchText]
FROM [Products] AS [p]
WHERE CONTAINS([p].[SearchText], N'''www*''') Which works. With the owned entity we generate this: SELECT [p].[Id], [t].[Id], [t].[Lookup_SearchText]
FROM [Products] AS [p]
LEFT JOIN (
SELECT [p0].[Id], [p0].[Lookup_SearchText], [p1].[Id] AS [Id0]
FROM [Products] AS [p0]
INNER JOIN [Products] AS [p1] ON [p0].[Id] = [p1].[Id]
WHERE [p0].[Lookup_SearchText] IS NOT NULL
) AS [t] ON [p].[Id] = [t].[Id]
WHERE CONTAINS([t].[Lookup_SearchText], N'''www*''') Which throws:
|
Expected error. #18299 should resolve this. Note that Contains does not work in all cases especially if a pushdown is caused on it. (Subquery removes Full text index). |
Closing as a duplicate of #18299 |
I use a table with a complex type (".OwnsOne(...)").
I think it's because of the "unnecessary" LEFT JOIN:
#18299
The text was updated successfully, but these errors were encountered: