Skip to content

Nullable-operand-pair sweep: every binary member over two nullable operands, including CASE and COALESCE operands #376

Closed

Description

@CaffeinatedCoder

Problem

The nullable-column sweeps pair one nullable column with a non-null captured operand. A binary member with two operands that can each be NULL is reached only by a hand-written row or two. #355's table shows the shape EF Core writes for two nullable columns, a IS NULL OR b IS NULL OR NOT (a && b), but nothing asserts it for every member, nor for operands EF Core builds itself: a conditional (c ? r.A : r.B, a CASE) and a coalesce (r.A ?? r.B, a COALESCE), whose nullability EF Core infers rather than reads from a column.

Change

A sweep, NullableOperandPairProbeTests (integration project, a database of its own). Two nullable columns per family (a range, a RangeSet, a value set), with rows for (null, null), (null, value), (value, null) and (value, value), the values including empty and (,). Every discovered binary member of RangeExtensions, RangeSet and ValueSetExtensions (predicates and value-producing members) and the RangeSet operators, with the operands taken from the two columns, from a CASE over them and from a COALESCE of them. Predicates in a filter, negated and projected; value-producing members projected and tested against null.

The oracle is LINQ over the loaded rows, with rule (c) where memory throws for a null: a predicate is false, a value-producing member is NULL. Disagreements go through Candidates.Verdict.

Done when

Registered in test/oracles/oracles.json, shown to catch range-predicate-over-a-null-column-is-null.patch and value-set-predicate-over-a-null-column-is-null.patch; 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