-
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
The multi-part identifier "o.Id" could not be bound #20813
Comments
Workaround: Try |
I'll give the workaround a shot and report back. I was able to get the SQLite query that is failing as well. The error that it is reporting is:
|
The workaround solved the issue for SQL Server and Azure SQL but SQLite still throws the same exception. |
another related issue: #20505 |
- Don't apply Include on entities with Include already applied - Update table references when pushing down select into left for set operation - Update identifiers after applying set operation if the projection removed exiting identifiers - Update SQL references in pending collection during push down Fix for the repro in #17337 Resolves #18738 Resolves #19763 Resolves #19947 Resolves #20813 Resolves #21026 Resolves #22222 Resolves #23676 Resolves #23720
- Don't apply Include on entities with Include already applied - Update table references when pushing down select into left for set operation - Update identifiers after applying set operation if the projection removed exiting identifiers - Update SQL references in pending collection during push down Fix for the repro in #17337 Resolves #18738 Resolves #19763 Resolves #19947 Resolves #20813 Resolves #21026 Resolves #22222 Resolves #23676 Resolves #23720 Resolves #24216
- Don't apply Include on entities with Include already applied - Update table references when pushing down select into left for set operation - Update identifiers after applying set operation if the projection removed exiting identifiers - Update SQL references in pending collection during push down Fix for the repro in #17337 Resolves #18738 Resolves #19763 Resolves #19947 Resolves #20813 Resolves #21026 Resolves #22222 Resolves #23676 Resolves #23720 Resolves #24216
- Don't apply Include on entities with Include already applied - Update table references when pushing down select into left for set operation - Update identifiers after applying set operation if the projection removed exiting identifiers - Update SQL references in pending collection during push down Fix for the repro in #17337 Resolves #18738 Resolves #19763 Resolves #19947 Resolves #20813 Resolves #21026 Resolves #22222 Resolves #23676 Resolves #23720 Resolves #24216
- Don't apply Include on entities with Include already applied - Update table references when pushing down select into left for set operation - Update identifiers after applying set operation if the projection removed exiting identifiers - Update SQL references in pending collection during push down Fix for the repro in #17337 Resolves #18738 Resolves #19763 Resolves #19947 Resolves #20813 Resolves #21026 Resolves #22222 Resolves #23676 Resolves #23720 Resolves #24216
We are using .NET Core 3.1 with EF Core 3.1.3.
I have the following LINQ query. This is a scaled down version of the full query that still illustrates the issue.
It is generating the following SQL.
The problem is that the WHERE clause in the OUTER APPLY is referencing [o] but the scope of [o] is the subselect inside the origin FROM clause. Basically, that WHERE clause has no idea what [o] is referring to.
My (minimal) entity definitions are shown below. I had to manually hack out all the unrelated cruft. I'm pretty sure I didn't hack out too much but let me know if something is missing.
Any suggestions or assistance would be greatly appreciated. I'm happy to try anything that anyone might suggest.
I should also add that our unit tests use an in-memory SQLite database to actually exercise the query (yes, I know, that makes them integration tests, not unit tests). They also fail but with a different error message (although I suspect it's for the same reason).
Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'near "(": syntax error'.
I haven't had a chance to try to extract the generated SQL statement but will update this issue once I've been able to do so.
The text was updated successfully, but these errors were encountered: