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
10.x: the range factories over a NULL element build a range instead of answering NULL (port of #382) #388
The same defect as #382, on release/10.x. When an element argument is NULL, the translated CreateFinite, CreateUnboundedStart and CreateUnboundedEnd still build a range. CreateFinite falls into its inverted-bounds guard and gives empty. The other two pass the NULL to PostgreSQL's range constructor, which reads a NULL bound as unbounded and gives (,). So even a positive filter selects a row that has no element: DateRange.CreateUnboundedEnd(b.Visit!.From).Contains(v) is true for a booking without a visit. EF Core answers NULL for its own value-producing members (b.Visit!.From.AddDays(1)).
Rule (c)'s predicate wrapper (#357) can't catch this, because daterange(NULL, NULL, '[)') IS NOT NULL is true. GuardedFiniteRangeConstructor and RangeConstructor are the same on both lines.
Change
Cherry-pick the #382 fix with -x, with its regression test. When an element argument can be NULL, the translation becomes CASE WHEN a IS NULL OR b IS NULL THEN NULL ELSE <today's translation> END, declared nullable. Required arguments keep today's SQL. It's SQL only: in memory the call can't be made.
The probes that found it (OuterJoinProbeTests, PR #383) are on main only, so the port's own test has to cover a value, == null, IsEmpty() and Contains(v).
Release
silent: one row under ### Changed answers in ## [10.2.0], linking this issue and its entry under docs/migration.md#changed-answers-in-1020. Fixed only on release/10.x, so close it by hand (#365).
PR #394 (stacked on PR #393) cherry-picks the #382 fix (PR #392) with -x, and adds NullElementTests.RangeFactories_OverANullElement_AreNull. With the fix stripped, that test and the SQL pins fail.
Activity
CaffeinatedCoder commentedon Oct 24, 2026
PR #394 (stacked on PR #393) cherry-picks the #382 fix (PR #392) with
-x, and addsNullElementTests.RangeFactories_OverANullElement_AreNull. With the fix stripped, that test and the SQL pins fail.test: hold the 10.x NULL-element fixes where a predicate consumes them (