Skip to content

Fix JSON null type mapping on hotfix#3856

Open
roji wants to merge 1 commit into
npgsql:hotfix/10.0.3from
roji:roji/hotfix-json-null-ci
Open

Fix JSON null type mapping on hotfix#3856
roji wants to merge 1 commit 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

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>
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