Skip to content

Fix JSON null type mapping on hotfix#3856

Merged
roji merged 2 commits into
npgsql:hotfix/10.0.3from
roji:roji/hotfix-json-null-ci
Jun 3, 2026
Merged

Fix JSON null type mapping on hotfix#3856
roji merged 2 commits into
npgsql:hotfix/10.0.3from
roji:roji/hotfix-json-null-ci

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Jun 2, 2026

The hotfix backport of #3855 fails CI because EF10's type-mapping postprocessor rejects the unmapped string literal used as the operand for the generated JSON null cast.

This assigns the literal operand its string type mapping before converting it to the JSON mapping, preserving the existing SQL shape while keeping the expression tree fully typed.

Tests:

  • EFCore.PG -> /Users/roji/.copilot/repos/copilot-worktrees/efcore.pg/roji-cautious-train/src/EFCore.PG/bin/Release/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll
    EFCore.PG.NTS -> /Users/roji/.copilot/repos/copilot-worktrees/efcore.pg/roji-cautious-train/src/EFCore.PG.NTS/bin/Release/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.dll
    EFCore.PG.NodaTime -> /Users/roji/.copilot/repos/copilot-worktrees/efcore.pg/roji-cautious-train/src/EFCore.PG.NodaTime/bin/Release/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime.dll
    EFCore.PG.FunctionalTests -> /Users/roji/.copilot/repos/copilot-worktrees/efcore.pg/roji-cautious-train/test/EFCore.PG.FunctionalTests/bin/Release/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.FunctionalTests.dll
    EFCore.PG.Tests -> /Users/roji/.copilot/repos/copilot-worktrees/efcore.pg/roji-cautious-train/test/EFCore.PG.Tests/bin/Release/net10.0/Npgsql.EntityFrameworkCore.PostgreSQL.Tests.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:17.87

roji and others added 2 commits June 2, 2026 22:54
Assign a string type mapping to the JSON null literal operand before casting it to the JSON mapping, avoiding EF10 type-mapping postprocessor failures in ExecuteUpdate JSON tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 10.0.3 hotfix branch defaults to compatibility SQL which uses jsonb_set with JSON-null fallbacks rather than jsonb_set_lax. Update the backported SQL baselines to match the hotfix branch output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roji roji merged commit 01c4273 into npgsql:hotfix/10.0.3 Jun 3, 2026
10 checks passed
@roji roji deleted the roji/hotfix-json-null-ci branch June 3, 2026 17:09
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.

1 participant