Skip to content

Commit

Permalink
What happens if the CASE transformation is always applied
Browse files Browse the repository at this point in the history
(just looking at NullSemanticsQuerySqliteTest)
  • Loading branch information
ranma42 committed Jul 27, 2024
1 parent 4c3a542 commit ecdd12e
Show file tree
Hide file tree
Showing 2 changed files with 241 additions and 63 deletions.
4 changes: 1 addition & 3 deletions src/EFCore.Relational/Query/SqlNullabilityProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1820,9 +1820,7 @@ private SqlExpression RewriteNullSemantics(
// a == b && some_column IS NOT NULL
// as we consider it simpler than the CASE expression; additionally it
// might take advantage of indexes on some_column, on a and/or on b.
if (leftNullable && rightNullable
|| leftIsNull is SqlUnaryExpression { Operand: ColumnExpression }
|| rightIsNull is SqlUnaryExpression { Operand: ColumnExpression })
if (leftNullable && rightNullable)
{
// (a == b && (a != null && b != null)) || (a == null && b == null)
body = _sqlExpressionFactory.OrElse(
Expand Down
Loading

0 comments on commit ecdd12e

Please sign in to comment.