Skip to content
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

[release/9.0] Fix TPC equality check inside subquery predicate (#35120) #35201

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

roji
Copy link
Member

@roji roji commented Nov 25, 2024

Fixes #35118
Port of #35120

Description
The deep query pipeline re-architecting in 9.0 included turning our SQL expression tree into a real tree rather than a graph, i.e. removing cycles where a SQL table was referenced both from its containing SelectExpression, and from any referencing columns. As a result, a changed predicate check for TPC inheritance was broken and did not correctly access the column's table when the column was nested in a subquery and referenced an outer table.

Customer impact
LINQ queries including a minimal equality predicate where a column references an outer table are now broken. For example:

var results = await context.As
    .Where(a => context.As.Where(g => a.Name == "A").Any())
    .ToListAsync();

These queries are sufficiently common, and the fix sufficiently simple, that servicing seems justified.

How found
Customer reported on 9.0.0

Regression
Yes, from 8.0.

Testing
Test added.

Risk
Low, quirk added.

@roji roji marked this pull request as ready for review November 25, 2024 15:50
@roji roji requested a review from a team November 25, 2024 16:17
@roji
Copy link
Member Author

roji commented Nov 26, 2024

Approved via email

@roji roji merged commit a8c7b9d into dotnet:release/9.0-staging Nov 26, 2024
7 checks passed
@roji roji deleted the GetTable9 branch November 26, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants