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