Skip to content

[9.0] Fix byte-array projections from JSON collections - #4074

Merged
roji merged 1 commit into
hotfix/9.0.5from
roji-json-binary-backport-9-0
Oct 22, 2026
Merged

roji merged 1 commit into
hotfix/9.0.5from
roji-json-binary-backport-9-0

Conversation

@roji

@roji roji commented Oct 22, 2026

Copy link
Copy Markdown
Member

Backport #4067 to hotfix/9.0.5.

Fixes #3566.

Preserve the merged JSON postprocessor and its explanatory comments unchanged: extract affected json_to_recordset/jsonb_to_recordset binary fields as text and decode their references after relational postprocessing, keeping SQL flat without wrapper subqueries.

Adapt regression coverage to EF9's owned ToJson collection mapping in AdHocJsonQueryNpgsqlTest. Cover json/jsonb, sync/async execution, exact bytes [0, 1, 127, 128, 255], empty/null values, full-document materialization versus collection projection, and server-side binary equality. No dependency changes or main-only warning suppressions.

Validation: all four regression cases failed with the original base64-text bytes before the fix and pass afterward, including SQL baselines. EF9 JSON suites passed against an isolated PostgreSQL 17 container: 1,453 passed, 13 skipped.

LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 dotnet test test/EFCore.PG.FunctionalTests/EFCore.PG.FunctionalTests.csproj --no-build --no-restore --filter 'FullyQualifiedName~Json' --verbosity minimal

Backport #4067, retaining the late JSON postprocessor and its comments. Adapt regression coverage to EF9 owned ToJson collection mapping for json/jsonb, sync/async, null/empty payloads, and binary equality.

Fixes #3566

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f9d39831-0c6c-4de0-9216-259844517ec4
@roji
roji merged commit 3c7e794 into hotfix/9.0.5 Oct 22, 2026
8 checks passed
@roji
roji deleted the roji-json-binary-backport-9-0 branch October 22, 2026 12:54
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.

Byte array in owned entity mapped to JSON returns different value when using projection

1 participant