Skip to content

[9.0] Fix null propagation in date/time interval construction - #4017

Merged
roji merged 1 commit into
hotfix/9.0.5from
roji-backport-interval-fix-9-0
Oct 18, 2026
Merged

roji merged 1 commit into
hotfix/9.0.5from
roji-backport-interval-fix-9-0

Conversation

@roji

@roji roji commented Oct 18, 2026

Copy link
Copy Markdown
Member

Backport of #4008 to hotfix/9.0.5.

Use PostgreSQL concatenation semantics when constructing date/time intervals so nullable arguments propagate as null instead of producing invalid interval strings. Normal C# string-concatenation behavior remains unchanged.

Adapt the regression coverage to 9.0's existing ad hoc query tests rather than importing newer temporal fixtures. Cover nullable DateTime.AddDays and DateOnly.AddYears/AddMonths arguments, zero and positive/negative fractional day intervals, and normal C# concatenation. Update the existing parameterized-interval SQL baseline.

Validation: reproduced PostgreSQL error 22007 before the fix; the focused temporal, parameterized-interval, and string-concatenation selection passes on .NET 9 / PostgreSQL 18.4 (172 passed, 4 existing skips), serialized with the shared backport database lock.

Fixes #2889

Backport #4008 to hotfix/9.0.5, adapting regression coverage to the existing ad hoc query test infrastructure.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 4380d91d-c065-4628-b4b6-a7b941d89577
@roji roji linked an issue Oct 18, 2026 that may be closed by this pull request
@roji
roji merged commit dd1f29c into hotfix/9.0.5 Oct 18, 2026
10 checks passed
@roji
roji deleted the roji-backport-interval-fix-9-0 branch October 18, 2026 11:32
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.

PostgresException: 22007: invalid input syntax for type interval: " days"

1 participant