Skip to content

Outer-join sweep: range, RangeSet and value set members over the NULL a left join or optional navigation produces from a required column #375

Closed

Description

@CaffeinatedCoder

Problem

The null sweeps of #350/#355 (ExecutedQueryTests.EveryPredicate_OverANullableColumn_IsFalseForTheNullRow) put the NULL in a nullable column. An outer join produces a NULL from a required column: a parent with no child reads the child's range, RangeSet, value set and element columns as NULL, though the model says none of them can be. EF Core's nullability processing decides from the model what can be NULL, so a translation that is right over a nullable column can still be wrong here. The bound accessors (#349) and the range factories over element columns are the members most exposed.

Change

A sweep, OuterJoinProbeTests (integration project, a database of its own), over parents with one child, parents with none, and a child per shape (finite, unbounded either side, (,), empty). The joined value is reached three ways: GroupJoin(…).SelectMany(… DefaultIfEmpty()), a LINQ join … into … from c in cs.DefaultIfEmpty(), and an optional reference navigation. Over it: every discovered Boolean member of RangeExtensions, RangeSet and ValueSetExtensions in a filter, a negated filter and a projection; the bounds against null and through ??; the value-producing members against null; the range factories over the child's element columns; ?? fallback on the joined range itself.

The oracle is the same query in memory over the loaded parents and children, with the missing child guarded explicitly (c == null ? … : …): rule (c) for a predicate (false, negation true), NULL for a bound or a value-producing member of a missing range. Disagreements go through Candidates.Verdict, one line per operation, join form and row.

Done when

Registered in test/oracles/oracles.json with a seed it is shown to catch, and every disagreement is an issue and a candidates.json entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/range-setRangeSet and multirange algebraarea/rangesRange unions, variants and the shape enginesarea/value-setsValue set families and wrapper aritiespackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLtestsAdds or changes tests only (oracles, harnesses); no library code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions