From be944b31920ae944775ae36d71027b5f9a276e56 Mon Sep 17 00:00:00 2001 From: Christopher Jolly Date: Wed, 8 Nov 2023 20:56:24 +0800 Subject: [PATCH] Fix some result sql differences between oledb and odbc --- .../NonSharedModelBulkUpdatesJetTest.cs | 1 + .../GreenTests/ace_2010_oledb_x86.txt | 20 ++++--- .../Query/NullSemanticsQueryJetTest.cs | 52 +++++++++---------- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/test/EFCore.Jet.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesJetTest.cs b/test/EFCore.Jet.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesJetTest.cs index 238abb0..da7b2e1 100644 --- a/test/EFCore.Jet.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesJetTest.cs @@ -92,6 +92,7 @@ SET `b`.`CreationTimestamp` = #2020-01-01# """); } + //see efcore 31407 for the same problem on SQL Server public override async Task Update_non_main_table_in_entity_with_entity_splitting(bool async) { await base.Update_non_main_table_in_entity_with_entity_splitting(async); diff --git a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt index 5019351..987ee32 100644 --- a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt +++ b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt @@ -87,8 +87,6 @@ EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJet EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Delete_predicate_based_on_optional_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_main_table_in_entity_with_entity_splitting(async: False) EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_main_table_in_entity_with_entity_splitting(async: True) -EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_non_main_table_in_entity_with_entity_splitting(async: False) -EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_non_main_table_in_entity_with_entity_splitting(async: True) EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_non_owned_property_on_entity_with_owned(async: False) EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_non_owned_property_on_entity_with_owned(async: True) EntityFrameworkCore.Jet.FunctionalTests.BulkUpdates.NonSharedModelBulkUpdatesJetTest.Update_non_owned_property_on_entity_with_owned2(async: False) @@ -15258,15 +15256,15 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.NullSemanticsQueryJetTest.Where_nu EntityFrameworkCore.Jet.FunctionalTests.Query.NullSemanticsQueryJetTest.Where_nullable_bool_with_null_check(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NullSemanticsQueryJetTest.Where_nullable_bool(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.NullSemanticsQueryJetTest.Where_nullable_bool(async: True) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Double_negate_on_column -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Negate_on_binary_expression(async: False) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Negate_on_binary_expression(async: True) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Negate_on_column(async: False) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Negate_on_column(async: True) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Negate_on_like_expression(async: False) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Negate_on_like_expression(async: True) -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Or_on_two_nested_binaries_and_another_simple_comparison -EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQuerySqlServerTest.Projection_with_not_and_negation_on_integer +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Double_negate_on_column +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_binary_expression(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_binary_expression(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_column(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_column(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_like_expression(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_like_expression(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Or_on_two_nested_binaries_and_another_simple_comparison +EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Projection_with_not_and_negation_on_integer EntityFrameworkCore.Jet.FunctionalTests.Query.OwnedEntityQueryJetTest.Join_selects_with_duplicating_aliases_and_owned_expansion_uniquifies_correctly(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.OwnedEntityQueryJetTest.Join_selects_with_duplicating_aliases_and_owned_expansion_uniquifies_correctly(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.OwnedEntityQueryJetTest.Multiple_owned_reference_mapped_to_own_table_containing_owned_collection_in_split_query(async: False) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs index 94a8e88..5aa2e34 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs @@ -886,12 +886,12 @@ WHERE `e`.`NullableStringA` = 'Foo' OR `e`.`NullableStringA` IS NULL await base.Where_multiple_ands_with_nullable_parameter_and_constant(async); AssertSql( -""" +$""" @__prm3_2='Blah' (Size = 255) SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE (`e`.`NullableStringA` <> 'Foo' OR `e`.`NullableStringA` IS NULL) AND `e`.`NullableStringA` IS NOT NULL AND `e`.`NullableStringA` <> @__prm3_2 +WHERE (`e`.`NullableStringA` <> 'Foo' OR `e`.`NullableStringA` IS NULL) AND `e`.`NullableStringA` IS NOT NULL AND `e`.`NullableStringA` <> {AssertSqlHelper.Parameter("@__prm3_2")} """); } @@ -900,12 +900,12 @@ WHERE (`e`.`NullableStringA` <> 'Foo' OR `e`.`NullableStringA` IS NULL) AND `e`. await base.Where_multiple_ands_with_nullable_parameter_and_constant_not_optimized(async); AssertSql( -""" +$""" @__prm3_2='Blah' (Size = 255) SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE `e`.`NullableStringB` IS NOT NULL AND (`e`.`NullableStringA` <> 'Foo' OR `e`.`NullableStringA` IS NULL) AND `e`.`NullableStringA` IS NOT NULL AND `e`.`NullableStringA` <> @__prm3_2 +WHERE `e`.`NullableStringB` IS NOT NULL AND (`e`.`NullableStringA` <> 'Foo' OR `e`.`NullableStringA` IS NULL) AND `e`.`NullableStringA` IS NOT NULL AND `e`.`NullableStringA` <> {AssertSqlHelper.Parameter("@__prm3_2")} """); } @@ -1277,20 +1277,20 @@ WHERE `e`.`NullableBoolA` = `e`.`NullableBoolB` base.Switching_parameter_value_to_null_produces_different_cache_entry(); AssertSql( - """ + $""" @__p_0='True' SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE @__p_0 = TRUE +WHERE {AssertSqlHelper.Parameter("@__p_0")} = TRUE """, // - """ + $""" @__p_0='False' SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE @__p_0 = TRUE +WHERE {AssertSqlHelper.Parameter("@__p_0")} = TRUE """); } @@ -1650,36 +1650,36 @@ WHERE IIF(`e`.`NullableIntA` IS NULL, 0, `e`.`NullableIntA`) <> 0 await base.Negated_order_comparison_on_non_nullable_arguments_gets_optimized(async); AssertSql( -""" +$""" @__i_0='1' SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE `e`.`IntA` <= @__i_0 +WHERE `e`.`IntA` <= {AssertSqlHelper.Parameter("@__i_0")} """, // -""" +$""" @__i_0='1' SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE `e`.`IntA` < @__i_0 +WHERE `e`.`IntA` < {AssertSqlHelper.Parameter("@__i_0")} """, // -""" +$""" @__i_0='1' SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE `e`.`IntA` >= @__i_0 +WHERE `e`.`IntA` >= {AssertSqlHelper.Parameter("@__i_0")} """, // -""" +$""" @__i_0='1' SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE `e`.`IntA` > @__i_0 +WHERE `e`.`IntA` > {AssertSqlHelper.Parameter("@__i_0")} """); } @@ -2007,12 +2007,12 @@ FROM `Entities1` AS `e` WHERE `e`.`NullableBoolA` IS NOT NULL """, // -""" +$""" @__prm_0='False' SELECT `e`.`Id`, `e`.`BoolA`, `e`.`BoolB`, `e`.`BoolC`, `e`.`IntA`, `e`.`IntB`, `e`.`IntC`, `e`.`NullableBoolA`, `e`.`NullableBoolB`, `e`.`NullableBoolC`, `e`.`NullableIntA`, `e`.`NullableIntB`, `e`.`NullableIntC`, `e`.`NullableStringA`, `e`.`NullableStringB`, `e`.`NullableStringC`, `e`.`StringA`, `e`.`StringB`, `e`.`StringC` FROM `Entities1` AS `e` -WHERE @__prm_0 = IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) +WHERE {AssertSqlHelper.Parameter("@__prm_0")} = IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) """, // """ @@ -2033,12 +2033,12 @@ FROM `Entities1` AS `e` WHERE `e`.`NullableBoolA` IS NULL """, // -""" +$""" @__prm_0='False' SELECT `e`.`Id`, `e`.`BoolA`, `e`.`BoolB`, `e`.`BoolC`, `e`.`IntA`, `e`.`IntB`, `e`.`IntC`, `e`.`NullableBoolA`, `e`.`NullableBoolB`, `e`.`NullableBoolC`, `e`.`NullableIntA`, `e`.`NullableIntB`, `e`.`NullableIntC`, `e`.`NullableStringA`, `e`.`NullableStringB`, `e`.`NullableStringC`, `e`.`StringA`, `e`.`StringB`, `e`.`StringC` FROM `Entities1` AS `e` -WHERE @__prm_0 = IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) +WHERE {AssertSqlHelper.Parameter("@__prm_0")} = IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) """); } @@ -2053,12 +2053,12 @@ FROM `Entities1` AS `e` WHERE `e`.`NullableBoolA` IS NULL """, // -""" +$""" @__prm_0='False' SELECT `e`.`Id`, `e`.`BoolA`, `e`.`BoolB`, `e`.`BoolC`, `e`.`IntA`, `e`.`IntB`, `e`.`IntC`, `e`.`NullableBoolA`, `e`.`NullableBoolB`, `e`.`NullableBoolC`, `e`.`NullableIntA`, `e`.`NullableIntB`, `e`.`NullableIntC`, `e`.`NullableStringA`, `e`.`NullableStringB`, `e`.`NullableStringC`, `e`.`StringA`, `e`.`StringB`, `e`.`StringC` FROM `Entities1` AS `e` -WHERE @__prm_0 <> IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) +WHERE {AssertSqlHelper.Parameter("@__prm_0")} <> IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) """, // """ @@ -2079,12 +2079,12 @@ FROM `Entities1` AS `e` WHERE `e`.`NullableIntA` IS NULL """, // -""" +$""" @__prm_0='False' SELECT `e`.`Id`, `e`.`BoolA`, `e`.`BoolB`, `e`.`BoolC`, `e`.`IntA`, `e`.`IntB`, `e`.`IntC`, `e`.`NullableBoolA`, `e`.`NullableBoolB`, `e`.`NullableBoolC`, `e`.`NullableIntA`, `e`.`NullableIntB`, `e`.`NullableIntC`, `e`.`NullableStringA`, `e`.`NullableStringB`, `e`.`NullableStringC`, `e`.`StringA`, `e`.`StringB`, `e`.`StringC` FROM `Entities1` AS `e` -WHERE @__prm_0 <> IIF(`e`.`NullableIntA` IS NOT NULL, TRUE, FALSE) +WHERE {AssertSqlHelper.Parameter("@__prm_0")} <> IIF(`e`.`NullableIntA` IS NOT NULL, TRUE, FALSE) """, // """ @@ -2105,12 +2105,12 @@ FROM `Entities1` AS `e` WHERE `e`.`NullableBoolA` IS NOT NULL """, // -""" +$""" @__prm_0='False' SELECT `e`.`Id`, `e`.`BoolA`, `e`.`BoolB`, `e`.`BoolC`, `e`.`IntA`, `e`.`IntB`, `e`.`IntC`, `e`.`NullableBoolA`, `e`.`NullableBoolB`, `e`.`NullableBoolC`, `e`.`NullableIntA`, `e`.`NullableIntB`, `e`.`NullableIntC`, `e`.`NullableStringA`, `e`.`NullableStringB`, `e`.`NullableStringC`, `e`.`StringA`, `e`.`StringB`, `e`.`StringC` FROM `Entities1` AS `e` -WHERE @__prm_0 <> IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) +WHERE {AssertSqlHelper.Parameter("@__prm_0")} <> IIF(`e`.`NullableBoolA` IS NOT NULL, TRUE, FALSE) """); }