Repository navigation
[10.0] Fix reading empty multidimensional arrays - #6677
Merged
Merged
Conversation
Backport the empty-array rank fix and regression test from #6472 without the array converter refactor. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 9ed28964-ddbc-4ba3-99af-9428e97d0b7b
roji
force-pushed
the
roji-npgsql-10-empty-arrays
branch
from
October 18, 2026 10:55
004c2e9 to
9d5e3ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports only the empty-array rank fix and focused regression test from #6472 (fc81e74), without the converter refactor or unrelated cleanup.
PostgreSQL reports zero dimensions for empty arrays. Preserve the requested CLR rank when creating the result so
GetFieldValue<T[,]>()returns an empty multidimensional array instead of throwingInvalidCastException.Fixes #6675.
Validation against PostgreSQL 18.4:
ArrayTestspassed on .NET 8 and .NET 10: 66 passed and 2 skipped per target.double[,]round-trips with this backport, both directly and throughValueConverter<List<Vertex>, double[,]>, with shape/value assertions.Validation used
NuGetAudit=falsebecause the branch's existingMicrosoft.Build.Tasks.Git8.0.0 advisory otherwise fails restore as a warning-as-error. No dependencies or build configuration were changed.