Skip to content

Type the plugin's NULL constants in its type mappings instead of matching EF Core's empty-root shape #327

Open

Description

@CaffeinatedCoder

Problem

The fixes for #302 (10.x) and #290 (11 line) type the plugin's NULLs by recognising EF Core's output shapes. EmptyCollectionRewriter matches a table-less SELECT … WHERE FALSE whose projections are all NULL constants, and on 10.x also the older empty VALUES. The root cause is lower down: Npgsql writes a null constant without its type, and PostgreSQL resolves a bare NULL as text against the polymorphic range and array operators (42883).

Matching the shape has two costs:

Found by the 10.1.0 review on 2026-10-19 (as an altitude finding).

Question

Can the plugin's range and set type mappings write a typed null literal themselves (NULL::int4range, NULL::text[])? Then every null constant of the plugin's types would be typed wherever it appears, and the rewriter would reduce to the empty-VALUES case EF Core 10.0.0/10.0.1 needs. To answer it:

Release

Internal; no answer should change. If it is done, on both lines.

Activity

  1. added
    chore
    area/range-set
    area/value-sets
    package/efcore
    on Oct 19, 2026
  2. added
    package/efcore-nodatime
    on Oct 19, 2026
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/value-setschorepackage/efcorepackage/efcore-nodatime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions