You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting rownumber (Apply coming from SelectMany) has predicate on Select as p.Id != null && p.Id == c.ParentId && c.SomeNullableDateTime != null
We end up pulling the last term even though that is not part of join key and shouldn't be in partitions.
Faulty code which causes match
Resolves#26756
For property access on optional dependents sharing column with principal, we generate CaseExpression. In order to match them during join key search, we updated our recursive function to match shape of the test in CaseExpression which incorrectly matched similar structure outside of case block causing somewhat wrong join key to be extracted. While join key in itself could work, when generating partitions out of it due to paging operation, it gives incorrect results.
The fix is to match the special structure of CaseExpression.Test separately. Also made the key comparison match more robust by only allowing column or case block to appear in condition. Other structures don't represent part of join key in a comparison.
Null checks for join keys are handled separately so that we only remove null checks which are indeed used in comparison with other columns in other operations.
Resolves#26756
For property access on optional dependents sharing column with principal, we generate CaseExpression. In order to match them during join key search, we updated our recursive function to match shape of the test in CaseExpression which incorrectly matched similar structure outside of case block causing somewhat wrong join key to be extracted. While join key in itself could work, when generating partitions out of it due to paging operation, it gives incorrect results.
The fix is to match the special structure of CaseExpression.Test separately. Also made the key comparison match more robust by only allowing column or case block to appear in condition. Other structures don't represent part of join key in a comparison.
Null checks for join keys are handled separately so that we only remove null checks which are indeed used in comparison with other columns in other operations.
Query like this
When converting rownumber (Apply coming from SelectMany) has predicate on Select as
p.Id != null && p.Id == c.ParentId && c.SomeNullableDateTime != null
We end up pulling the last term even though that is not part of join key and shouldn't be in partitions.
Faulty code which causes match
efcore/src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs
Lines 2340 to 2341 in e451959
The text was updated successfully, but these errors were encountered: