From 86570559239e09e4997b45776be6b8cc5dde2fa8 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Tue, 2 Jun 2026 22:54:52 +0200 Subject: [PATCH 1/2] Fix JSON null type mapping on hotfix 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> --- .../NpgsqlQueryableMethodTranslatingExpressionVisitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs index 1a8cb5a4a..a20f17e02 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs @@ -1443,7 +1443,7 @@ protected override bool TrySerializeScalarToJson( private SqlExpression JsonNull(RelationalTypeMapping jsonTypeMapping) => new SqlUnaryExpression( ExpressionType.Convert, - _sqlExpressionFactory.Constant("null"), + _sqlExpressionFactory.Constant("null", _typeMappingSource.FindMapping(typeof(string))), jsonTypeMapping.ClrType, jsonTypeMapping); From ae310d527755203fb4c021e3cdc2137e27ddd45b Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 3 Jun 2026 18:38:07 +0200 Subject: [PATCH 2/2] Update hotfix JSON update baselines 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> --- .../ComplexJsonBulkUpdateNpgsqlTest.cs | 28 +++++++++---------- .../Types/Miscellaneous/NpgsqlBoolTypeTest.cs | 6 ++-- .../Miscellaneous/NpgsqlByteArrayTypeTest.cs | 8 +++--- .../Types/Miscellaneous/NpgsqlGuidTypeTest.cs | 6 ++-- .../Miscellaneous/NpgsqlStringTypeTest.cs | 8 +++--- .../Types/Networking/NpgsqlInetTypeTest.cs | 8 +++--- .../Types/Networking/NpgsqlMacaddrTypeTest.cs | 8 +++--- .../Types/Numeric/NpgsqlDecimalTypeTest.cs | 6 ++-- .../Types/Numeric/NpgsqlDoubleTypeTest.cs | 6 ++-- .../Types/Numeric/NpgsqlFloatTypeTest.cs | 6 ++-- .../Types/Numeric/NpgsqlIntTypeTest.cs | 6 ++-- .../Types/Numeric/NpgsqlLongTypeTest.cs | 6 ++-- .../Types/Numeric/NpgsqlShortTypeTest.cs | 6 ++-- .../Types/Temporal/NpgsqlDateOnlyTypeTest.cs | 6 ++-- .../Temporal/NpgsqlDateTimeOffsetTypeTest.cs | 6 ++-- .../NpgsqlDateTimeUnspecifiedTypeTest.cs | 6 ++-- .../Temporal/NpgsqlDateTimeUtcTypeTest.cs | 6 ++-- .../Types/Temporal/NpgsqlTimeOnlyTypeTest.cs | 6 ++-- .../Types/Temporal/NpgsqlTimeSpanTypeTest.cs | 6 ++-- 19 files changed, 72 insertions(+), 72 deletions(-) diff --git a/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateNpgsqlTest.cs index f9e3e218b..91705f78a 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateNpgsqlTest.cs @@ -49,7 +49,7 @@ public override async Task Update_property_inside_associate() @p='?' UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{String}', to_jsonb(@p)) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{String}', to_jsonb(@p)) """); } @@ -60,7 +60,7 @@ public override async Task Update_property_inside_associate_with_special_chars() AssertExecuteUpdateSql( """ UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{String}', to_jsonb('{ Some other/JSON:like text though it [isn''t]: ממש ממש לאéèéè }'::text)) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{String}', to_jsonb('{ Some other/JSON:like text though it [isn''t]: ממש ממש לאéèéè }'::text)) WHERE (r."RequiredAssociate" ->> 'String') = '{ this may/look:like JSON but it [isn''t]: ממש ממש לאéèéè }' """); } @@ -74,7 +74,7 @@ public override async Task Update_property_inside_nested_associate() @p='?' UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{RequiredNestedAssociate,String}', to_jsonb(@p)) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{RequiredNestedAssociate,String}', to_jsonb(@p)) """); } @@ -87,7 +87,7 @@ public override async Task Update_property_on_projected_associate() @p='?' UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{String}', to_jsonb(@p)) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{String}', to_jsonb(@p)) """); } @@ -131,7 +131,7 @@ public override async Task Update_nested_associate_to_parameter() @complex_type_p='?' (DbType = Object) UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{RequiredNestedAssociate}', @complex_type_p) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{RequiredNestedAssociate}', @complex_type_p) """); } @@ -258,7 +258,7 @@ public override async Task Update_nested_collection_to_parameter() @complex_type_p='?' (DbType = Object) UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{NestedCollection}', @complex_type_p) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{NestedCollection}', @complex_type_p) """); } @@ -280,7 +280,7 @@ public override async Task Update_nested_collection_to_another_nested_collection AssertExecuteUpdateSql( """ UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{NestedCollection}', r."OptionalAssociate" -> 'NestedCollection') +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{NestedCollection}', COALESCE(r."OptionalAssociate" -> 'NestedCollection', 'null'::jsonb)) WHERE (r."OptionalAssociate") IS NOT NULL """); } @@ -323,7 +323,7 @@ public override async Task Update_primitive_collection_to_parameter() @ints='?' (DbType = Object) UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{Ints}', @ints) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{Ints}', @ints) """); } @@ -347,7 +347,7 @@ public override async Task Update_inside_primitive_collection() @p='?' (DbType = Int32) UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{Ints,1}', to_jsonb(@p)) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{Ints,1}', to_jsonb(@p)) WHERE jsonb_array_length(r."RequiredAssociate" -> 'Ints') >= 2 """); } @@ -366,7 +366,7 @@ public override async Task Update_multiple_properties_inside_same_associate() @p1='?' (DbType = Int32) UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(jsonb_set_lax(r."RequiredAssociate", '{String}', to_jsonb(@p)), '{Int}', to_jsonb(@p1)) +SET "RequiredAssociate" = jsonb_set(jsonb_set(r."RequiredAssociate", '{String}', to_jsonb(@p)), '{Int}', to_jsonb(@p1)) """); } @@ -380,8 +380,8 @@ public override async Task Update_multiple_properties_inside_associates_and_on_e UPDATE "RootEntity" AS r SET "Name" = r."Name" || 'Modified', - "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{String}', r."OptionalAssociate" -> 'String'), - "OptionalAssociate" = jsonb_set_lax(r."OptionalAssociate", '{RequiredNestedAssociate,String}', to_jsonb(@p)) + "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{String}', COALESCE(r."OptionalAssociate" -> 'String', 'null'::jsonb)), + "OptionalAssociate" = jsonb_set(r."OptionalAssociate", '{RequiredNestedAssociate,String}', to_jsonb(@p)) WHERE (r."OptionalAssociate") IS NOT NULL """); } @@ -395,8 +395,8 @@ public override async Task Update_multiple_projected_associates_via_anonymous_ty @p='?' UPDATE "RootEntity" AS r -SET "RequiredAssociate" = jsonb_set_lax(r."RequiredAssociate", '{String}', r."OptionalAssociate" -> 'String'), - "OptionalAssociate" = jsonb_set_lax(r."OptionalAssociate", '{String}', to_jsonb(@p)) +SET "RequiredAssociate" = jsonb_set(r."RequiredAssociate", '{String}', COALESCE(r."OptionalAssociate" -> 'String', 'null'::jsonb)), + "OptionalAssociate" = jsonb_set(r."OptionalAssociate", '{String}', to_jsonb(@p)) WHERE (r."OptionalAssociate") IS NOT NULL """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlBoolTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlBoolTypeTest.cs index e8169d585..de95a3610 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlBoolTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlBoolTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='False' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(FALSE::boolean)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(FALSE::boolean)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlByteArrayTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlByteArrayTypeTest.cs index 14abcdf53..64f697137 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlByteArrayTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlByteArrayTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='0x04050607' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(encode(@Fixture_OtherValue, 'base64'))) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(encode(@Fixture_OtherValue, 'base64'))) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(encode(BYTEA E'\\x04050607', 'base64'))) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(encode(BYTEA E'\\x04050607', 'base64'))) """); } @@ -80,7 +80,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(encode(decode(j."JsonContainer" ->> 'OtherValue', 'base64'), 'base64'))) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(to_jsonb(encode(decode(j."JsonContainer" ->> 'OtherValue', 'base64'), 'base64')), 'null'::jsonb)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(encode(j."OtherValue", 'base64'))) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(to_jsonb(encode(j."OtherValue", 'base64')), 'null'::jsonb)) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlGuidTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlGuidTypeTest.cs index ab21e0ebb..057f204ee 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlGuidTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlGuidTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='ae192c36-9004-49b2-b785-8be10d169627' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb('ae192c36-9004-49b2-b785-8be10d169627'::uuid)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb('ae192c36-9004-49b2-b785-8be10d169627'::uuid)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlStringTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlStringTypeTest.cs index 97c5eaf82..b41cc561b 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlStringTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Miscellaneous/NpgsqlStringTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='bar' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb('bar'::text)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb('bar'::text)) """); } @@ -80,7 +80,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', j."JsonContainer" -> 'OtherValue') +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(j."JsonContainer" -> 'OtherValue', 'null'::jsonb)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(to_jsonb(j."OtherValue"), 'null'::jsonb)) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlInetTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlInetTypeTest.cs index 8650b7e9a..9241d48a5 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlInetTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlInetTypeTest.cs @@ -60,7 +60,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='192.168.1.2' (DbType = Object) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -71,7 +71,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(INET '192.168.1.2'::inet)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(INET '192.168.1.2'::inet)) """); } @@ -82,7 +82,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', j."JsonContainer" -> 'OtherValue') +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(j."JsonContainer" -> 'OtherValue', 'null'::jsonb)) """); } @@ -93,7 +93,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(to_jsonb(j."OtherValue"), 'null'::jsonb)) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlMacaddrTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlMacaddrTypeTest.cs index 9ccd71089..659e077f6 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlMacaddrTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Networking/NpgsqlMacaddrTypeTest.cs @@ -60,7 +60,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='001422012346' (DbType = Object) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -71,7 +71,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(MACADDR '001422012346'::macaddr)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(MACADDR '001422012346'::macaddr)) """); } @@ -82,7 +82,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', j."JsonContainer" -> 'OtherValue') +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(j."JsonContainer" -> 'OtherValue', 'null'::jsonb)) """); } @@ -93,7 +93,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', COALESCE(to_jsonb(j."OtherValue"), 'null'::jsonb)) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDecimalTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDecimalTypeTest.cs index 18a12a923..641d42d7b 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDecimalTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDecimalTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='30' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(30.0::numeric)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(30.0::numeric)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDoubleTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDoubleTypeTest.cs index 2c2f84680..3c9a2acb1 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDoubleTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlDoubleTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='30' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(30.0::double precision)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(30.0::double precision)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlFloatTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlFloatTypeTest.cs index 4ad71e477..d5504e90e 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlFloatTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlFloatTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='30' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(30::real)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(30::real)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlIntTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlIntTypeTest.cs index 60d9c71fb..482b86bc4 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlIntTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlIntTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='2147483647' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(2147483647::int)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(2147483647::int)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlLongTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlLongTypeTest.cs index f68da5ece..921c4635f 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlLongTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlLongTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='9223372036854775807' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(9223372036854775807::bigint)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(9223372036854775807::bigint)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlShortTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlShortTypeTest.cs index 3f41a8be5..e7c2f56ce 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlShortTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Numeric/NpgsqlShortTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='32767' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(32767::smallint)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(32767::smallint)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateOnlyTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateOnlyTypeTest.cs index 6eff3dc78..df22d978d 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateOnlyTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateOnlyTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='05/03/2022' (DbType = Date) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(DATE '2022-05-03'::date)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(DATE '2022-05-03'::date)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeOffsetTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeOffsetTypeTest.cs index ea9b42374..95ba4cc72 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeOffsetTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeOffsetTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='2020-01-05T13:30:45.0000000+00:00' (DbType = DateTime) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(TIMESTAMPTZ '2020-01-05T13:30:45+00:00'::timestamptz)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(TIMESTAMPTZ '2020-01-05T13:30:45+00:00'::timestamptz)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUnspecifiedTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUnspecifiedTypeTest.cs index b7495be80..57bc0c4ec 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUnspecifiedTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUnspecifiedTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='2022-05-03T00:00:00.0000000' UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(TIMESTAMP '2022-05-03T00:00:00'::timestamp)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(TIMESTAMP '2022-05-03T00:00:00'::timestamp)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUtcTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUtcTypeTest.cs index 4d4159e35..8f26b8942 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUtcTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlDateTimeUtcTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='2022-05-03T00:00:00.0000000Z' (DbType = DateTime) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(TIMESTAMPTZ '2022-05-03T00:00:00Z'::timestamptz)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(TIMESTAMPTZ '2022-05-03T00:00:00Z'::timestamptz)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeOnlyTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeOnlyTypeTest.cs index 800f82b95..e3c978f92 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeOnlyTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeOnlyTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='14:00' (DbType = Time) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(TIME '14:00:00'::time without time zone)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(TIME '14:00:00'::time without time zone)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); } diff --git a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeSpanTypeTest.cs b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeSpanTypeTest.cs index d1d0a841b..3093cb533 100644 --- a/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeSpanTypeTest.cs +++ b/test/EFCore.PG.FunctionalTests/Types/Temporal/NpgsqlTimeSpanTypeTest.cs @@ -58,7 +58,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @Fixture_OtherValue='14:00:00' (DbType = Object) UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(@Fixture_OtherValue)) """); } @@ -69,7 +69,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(INTERVAL '14:00:00'::interval)) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(INTERVAL '14:00:00'::interval)) """); } @@ -91,7 +91,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() AssertSql( """ UPDATE "JsonTypeEntity" AS j -SET "JsonContainer" = jsonb_set_lax(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) +SET "JsonContainer" = jsonb_set(j."JsonContainer", '{Value}', to_jsonb(j."OtherValue")) """); }