Skip to content

10.x: LowerBound() and UpperBound() in a query: == null becomes WHERE FALSE and ?? loses its COALESCE (port of #349) #354

Closed

Description

@CaffeinatedCoder

Problem

The same defect as #349, on release/10.x, which is what consumers on .NET 10 run (10.1.0 from nuget.org is where #349 was measured). BoundFunction in ValueRangesMethodCallTranslator.cs (line 639 there, identical to main before #353) declares lower() and upper() with argumentsPropagateNullability: [true]. So over a required column LowerBound() == null is WHERE FALSE, != null and HasValue filter nothing, ?? fallback loses its COALESCE, and on a nullable column the bound is tested with the column's own IS NULL. This holds for every range type and RangeSet.

Change

Done when

On release/10.x the bound sweep passes on PostgreSQL 16 and 18 with no #349 candidates left, and fails on the 234 range and RangeSet rows with the flag reverted. Close this issue by hand after the merge, since Closes only acts on main.

Status

PR #367 against release/10.x (after #366 opened 10.2.0): the two commits cherry-picked with -x, 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 flag reverted the bound sweep fails on the 234 rows.

Activity

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

    @CaffeinatedCoder
    OwnerAuthor

    Fixed on release/10.x by #367, merged as 7581ab7: lower()/upper() declared argumentsPropagateNullability: [false], the bound sweep over the range and RangeSet columns of every family, and the ### Changed answers row in [10.2.0] with ## Changed answers in 10.2.0 in docs/migration.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/rangesbreakingbugpackage/efcorepackage/efcore-nodatimeseverity/highsilent

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions