Skip to content

10.x: a predicate over a null range, RangeSet or value set is false in memory and in SQL (port of the predicate half of #350, #355 and #356) #357

Closed

Description

@CaffeinatedCoder

Problem

#350, #355 and #356 apply to release/10.x (10.1.0) unchanged. RangeExtensions.cs is identical on both lines, and the SQL measured for #355 is identical on EF Core 10.0.0 and on 10.0.13 with Npgsql 10.0.3.

Change (10.2.0)

The predicate half of rule (c) from #350, which only changes answers and so fits a minor under ### Changed answers:

Left as they are on 10.x, documented in docs/ranges.md and docs/efcore.md as undefined on a null range and throwing from 11.0.0:

  • Intersect (returns Empty);
  • Gap(Empty) (returns Empty); Gap with any other operand already throws;
  • Merge(Empty) (returns null through a non-nullable return type) and Merge((,)) (returns (,)); Merge with any other operand already throws.

Four of #350's twelve candidates therefore stay registered on 10.x: Intersect(p) != null, Intersect(p) == Empty, Gap(Empty).IsEmpty() and Merge(Infinite) == x. Union(Infinite).Contains(v) is fixed by #356, because memory throws for it.

Changelog: one ### Changed answers row per issue in [10.2.0], linking it and its docs/migration.md#changed-answers-in-1020 entry, in all the package changelogs it affects. Needs #331 to open 10.2.0 first.

Done when

On release/10.x, the widened #355 sweep passes on PostgreSQL 16 and 18 with only those four candidates left. The in-memory rows above are pinned by a test that fails with each change reverted. Close by hand after the merge.

Activity

  1. added
    bug
    silent
    area/ranges
    area/range-set
    area/value-sets
    package/efcore
    package/core
    package/efcore-nodatime
    severity/medium
    on Oct 24, 2026
  2. added this to the 10.2.0 milestone on Oct 24, 2026
  3. CaffeinatedCoder commented on Oct 24, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Both main sources are ready to port: #370 (merged as ded685a, #356) and #371 (#355 with #350's predicate half, open). Cherry-pick f4f05dd, then #371's commit, with -x. On 10.x, remove the same eight #350 candidates: Union(Infinite).Contains(v) and the seven predicates. Four stay, as on main until #350's 11.0.0 half; on 10.x they stay for good and get documented. Run every seed that patches RangeExtensions.cs, RangeSet.cs or either method-call translator with tools/oracles.cs seeds on the branch. On main, range-against-set-reads-first-element-for-upper-bound.patch needed refreshing.

  4. added
    breaking
    on Oct 24, 2026
  5. CaffeinatedCoder commented on Oct 24, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Port PR: #373 against release/10.x, the -x cherry-picks of f4f05dd (#370) and 8bd0048 (#371), with the [10.2.0] changelog rows, the migration subsections under ## Changed answers in 10.2.0, and the captured-list pins updated for 10.x's EmptyCollectionSql helper. Locally green on the EF Core floor and 10.0.13, and on PostgreSQL 16 and 18; all fifteen affected seeds are caught on the branch. Candidates 15 → 8.

  6. CaffeinatedCoder commented on Oct 24, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Fixed on release/10.x by #373, merged as d1180c5: a predicate over a null range, range set or value set is false in memory and in SQL, and RangeSet.From refuses a null range with ArgumentException. [10.2.0] has the ### Changed answers rows, and docs/migration.md has the subsections under ## Changed answers in 10.2.0. #350's value-producing half stays 11.0.0-only, documented on 10.x in docs/ranges.md. Ships in 10.2.0 (#358). Closed by hand, since Closes acts only on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/range-setarea/rangesarea/value-setsbreakingbugpackage/corepackage/efcorepackage/efcore-nodatimeseverity/mediumsilent

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions