Skip to content

10.x: RangeIntersectAgg returns empty over a sequence holding a null range, where range_intersect_agg skips the NULL; RangeAgg throws (port of #361) #363

Closed

Description

@CaffeinatedCoder

Problem

The same defect as #361, on release/10.x (10.1.0). RangeAggregateExtensions.cs and RangeSet.cs are identical to main, and docs/ranges.md#aggregate-a-sequence-of-ranges makes the same promise: the two are "the in-memory versions of PostgreSQL's range_agg and range_intersect_agg". Those skip NULL inputs. The in-memory versions don't. Over a nullable DateRange column holding NULL, [2026-03-01,2026-03-10], [2026-03-05,2026-03-25] and NULL:

  • RangeIntersectAgg() returns empty in memory and [2026-03-05,2026-03-10] in SQL, with no exception.
  • RangeAgg() throws InvalidOperationException in memory and returns {[2026-03-01,2026-03-25]} in SQL.

Change (10.2.0)

Done when

On release/10.x, RangeAggregateParityTests over a nullable column holding NULLs among other shapes passes on PostgreSQL 16 and 18 for every family, and fails with the fix reverted. Close by hand after the merge.

Activity

  1. added this to the 10.2.0 milestone on Oct 24, 2026
  2. added
    bugSomething isn't working
    silentAnswers wrongly without throwing — fixes go in the next major, never deferred
    area/rangesRange unions, variants and the shape engines
    area/range-setRangeSet and multirange algebra
    package/coreAffects CodoMetis.ValueRanges
    severity/lowCosmetic, message or documentation-level difference
    on Oct 24, 2026
  3. CaffeinatedCoder commented on Oct 24, 2026

    @CaffeinatedCoder
    OwnerAuthor

    The main fix is PR #368 (commit 99a6989). The port cherry-picks it with -x. It brings the seed test/oracles/seeds/aggregates-fold-a-null-input.patch and claim R48. Its ### Breaking lines under [11.0.0-preview.1] become a ### Changed answers row under [10.2.0] (core and NodaTime changelogs), and its migration subsection moves under ## Changed answers in 10.2.0. Run dotnet run tools/oracles.cs seeds agg on the branch: the three existing aggregate seeds must still apply there.

  4. added
    breakingChanges an answer or a signature — needs a major
    package/nodatimeAffects CodoMetis.ValueRanges.NodaTime
    on Oct 24, 2026
  5. CaffeinatedCoder commented on Oct 24, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Port PR: #369 against release/10.x, the -x cherry-pick of 99a6989 with the changelog and migration entries rewritten for [10.2.0] / ## Changed answers in 10.2.0. Locally green on PostgreSQL 16 and 18 and on EF Core 10.0.13 / Npgsql 10.0.3. With the fix reverted the four new tests fail, and all four aggregate seeds are caught on the branch.

  6. CaffeinatedCoder commented on Oct 24, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Fixed on release/10.x by #369, merged as 87b473a: RangeAgg() and RangeIntersectAgg() skip a null range or set, in every per-type overload (core and NodaTime) and both set overloads, with the ### Changed answers row in [10.2.0] and the subsection under ## Changed answers in 10.2.0. 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-setRangeSet and multirange algebraarea/rangesRange unions, variants and the shape enginesbreakingChanges an answer or a signature — needs a majorbugSomething isn't workingpackage/coreAffects CodoMetis.ValueRangespackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/lowCosmetic, message or documentation-level differencesilentAnswers wrongly without throwing — fixes go in the next major, never deferred

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions