Skip to content

[8.0] Fix null checks on unbounded NodaTime Interval bounds - #4003

Merged
roji merged 2 commits into
hotfix/8.0.12from
roji-interval-bounds-backport-8-0
Oct 18, 2026
Merged

roji merged 2 commits into
hotfix/8.0.12from
roji-interval-bounds-backport-8-0

Conversation

@roji

@roji roji commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Backport of #3999.

Fixes #3585.

Correct the nullability metadata for Interval.Start and Interval.End: PostgreSQL lower() and upper() can return null for unbounded intervals even when the interval itself is non-null.

Adapt the regression test to the 8.0 branch's existing NodaTimeQueryNpgsqlTest class, array syntax, and SQL baseline (::timestamptz casts on nullable projected bounds). The test covers synchronous and asynchronous queries, verifies nullable projected bounds and exact SQL, and rolls back its data change within an execution strategy.

Validation: the NodaTime functional-test project builds successfully with .NET 8. All 38 focused Interval/DateInterval tests pass, with no failures or skips.

Test__Npgsql__DefaultConnection='Host=localhost;Username=npgsql_tests' dotnet test test/EFCore.PG.NodaTime.FunctionalTests/EFCore.PG.NodaTime.FunctionalTests.csproj --no-restore --filter 'FullyQualifiedName~NodaTimeQueryNpgsqlTest.Interval_|FullyQualifiedName~NodaTimeQueryNpgsqlTest.DateInterval_' --verbosity quiet --logger 'console;verbosity=minimal'

roji and others added 2 commits October 17, 2026 16:36
Backport of #3999. Relocate the regression test to the 8.0 NodaTime query test class.

Fixes #3585

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 7b455e57-24ef-439a-8fe6-fde42be305d6
EF Core 8 retains timestamptz casts when projecting nullable Interval bounds.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 7b455e57-24ef-439a-8fe6-fde42be305d6
@roji
roji merged commit 5a8f68a into hotfix/8.0.12 Oct 18, 2026
9 checks passed
@roji
roji deleted the roji-interval-bounds-backport-8-0 branch October 18, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Null check is wrongly dropped for NodaTime.Interval.Start and NodaTime.Interval.End with efcore linq2sql

1 participant