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
{{ message }}
Repository navigation
Typed filters: null checks over a computed operand and negated nullable comparisons are shaped unlike EF Core's #118
Typed filters keep C#'s answer for null operands since #68, but two of the shapes they use differ from what EF Core writes for the same lambda. The rows are the same; the predicate is not, so a partial index is not provably usable by EF Core's query for that lambda, and the parity sweep (#101) has to waive each such row.
Lambda
Package (5.5.0 candidate)
EF Core
x.Name.ToLower() != "a" (string? Name)
(lower("Name") <> 'a' OR lower("Name") IS NULL)
lower("Name") <> 'a' OR "Name" IS NULL
(x.Name ?? x.Alias) != "a" (both string?)
(coalesce("Name", "Alias") <> 'a' OR coalesce("Name", "Alias") IS NULL)
COALESCE("Name", "Alias") <> 'a' OR ("Name" IS NULL AND "Alias" IS NULL)
!(x.Count < 5) (int? Count)
("Count" >= 5 OR "Count" IS NULL)
CASE WHEN "Count" < 5 THEN FALSE ELSE TRUE END
EF Core tests the nullable columns under a computed operand (a strict function is null exactly when its nullable input is; a COALESCE when all of its inputs are), and writes a negated comparison over a nullable operand as a CASE.
Fix
Write the null checks over the operand's nullable columns, and the negation of a comparison over a nullable operand as EF Core's CASE. Both shapes are new in 5.5.0 (#68), so no released filter changes.
Activity
fix(postgresql): shape typed filters' null checks as EF Core does (#118)