Skip to content

[8.0] Fix BCE NodaTime SQL literal formatting - #4026

Merged
roji merged 1 commit into
hotfix/8.0.12from
roji-backport-8-bce-nodatime-literals
Oct 18, 2026
Merged

roji merged 1 commit into
hotfix/8.0.12from
roji-backport-8-bce-nodatime-literals

Conversation

@roji

@roji roji commented Oct 18, 2026

Copy link
Copy Markdown
Member

Backport of #4023, merged as 00b545696bdac254756b32aa4a25554001b82e91, to hotfix/8.0.12.

Format BCE NodaTime SQL literals using year-of-era plus BC for LocalDate, LocalDateTime, Instant (including legacy mappings), OffsetDateTime, ZonedDateTime, ranges and multiranges. Preserve existing ISO JSON serialization and infinity handling. BCE JSON-to-PostgreSQL casts remain outside this fix.

Port the source SQL/JSON and range/multirange coverage to the 8.0 test projects, using the branch's existing LocalDateTime extrema expressions. Add the original new LocalDate(Era.BeforeCommon, 384, 1, 1) regression expecting DATE '0384-01-01 BC'. No dependency updates or unrelated date/time fixes.

Validation:

  • dotnet test test/EFCore.PG.Tests/EFCore.PG.Tests.csproj --no-restore --filter 'FullyQualifiedName~NpgsqlTypeMappingTest' --verbosity quiet: 137 passed, 6 skipped.
  • dotnet test test/EFCore.PG.NodaTime.FunctionalTests/EFCore.PG.NodaTime.FunctionalTests.csproj --no-restore --filter 'FullyQualifiedName~NpgsqlNodaTimeTypeMappingTest' --verbosity quiet: 113 passed, including legacy mappings.
  • Read-only PostgreSQL checks accepted corrected BCE scalar, range and multirange literals.

Fixes #3532

Backport #4023 (00b5456) to hotfix/8.0.12. Preserve ISO JSON serialization and infinity handling, adapt test placement and LocalDateTime extrema to the 8.0 branch, and cover the original 384 BCE date.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 23da65c3-017a-4188-99fc-477970542012
@roji roji linked an issue Oct 18, 2026 that may be closed by this pull request
@roji
roji merged commit 4f1edcb into hotfix/8.0.12 Oct 18, 2026
9 checks passed
@roji
roji deleted the roji-backport-8-bce-nodatime-literals branch October 18, 2026 16:03
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.

Invalid PostgreSQL SQL literals for BCE NodaTime dates and timestamps

1 participant