diff --git a/Dependencies.targets b/Dependencies.targets index c4de0fa..6b46c8a 100644 --- a/Dependencies.targets +++ b/Dependencies.targets @@ -1,33 +1,33 @@ - [8.0.0-rc.2.23480.1, 9.0.0) + [8.0.0, 9.0.0) - - - + + + - + - - - - + + + + - + - - + + - + @@ -39,14 +39,14 @@ - + - + \ No newline at end of file diff --git a/global.json b/global.json index 2134c0c..61d88a7 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100-rc.2.23502.2", + "version": "8.0.100", "allowPrerelease": true, "rollForward": "latestFeature" } diff --git a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_odbc_x86.txt b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_odbc_x86.txt index fa2c0b2..a873f07 100644 --- a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_odbc_x86.txt +++ b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_odbc_x86.txt @@ -7602,22 +7602,42 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_com EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_complex_property(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_complex_property(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_struct_complex_property(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_struct_complex_property(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_optional_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_optional_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_required_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_required_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_optional_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_optional_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_required_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_required_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_optional_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_optional_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_required_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_required_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type_Distinct(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type_Distinct(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type_Where(async: False) @@ -7626,18 +7646,42 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_com EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Distinct(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Distinct(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Where(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Where(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_constant(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_constant(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_complex_property(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_complex_property(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_struct_complex_property(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_struct_complex_property(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.CompositeKeysQueryJetTest.Projecting_collections_multi_level(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.CompositeKeysQueryJetTest.Projecting_collections_multi_level(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.CompositeKeysQueryJetTest.Projecting_multiple_collections_on_multiple_levels_no_explicit_ordering(async: False) @@ -11227,6 +11271,8 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_over_unary_scalarsubquery(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_over_unary_unary(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_over_unary_unary(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select_scalar(isAsync: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select_scalar(isAsync: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select(isAsync: False) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select(isAsync: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Take_Union_Take(isAsync: False) @@ -12411,6 +12457,7 @@ 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.OwnedEntityQueryJetTest.Can_have_required_owned_type_on_derived_type 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) @@ -12839,6 +12886,8 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Comparing_enum_ EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Comparing_enum_casted_to_byte_with_int_constant(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Count_member_over_IReadOnlyCollection_works(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Count_member_over_IReadOnlyCollection_works(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Filter_on_nested_DTO_with_interface_gets_simplified_correctly(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Filter_on_nested_DTO_with_interface_gets_simplified_correctly(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Flattened_GroupJoin_on_interface_generic(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Flattened_GroupJoin_on_interface_generic(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.GroupBy_Aggregate_over_navigations_repeated(async: False) @@ -12906,8 +12955,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_annota EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_annotations_do_not_affect_successive_calls(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_contains(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_contains(async: True) -EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_nullable_predicate(async: False) -EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_nullable_predicate(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_empty_predicate(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_empty_predicate(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_predicate(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_predicate(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_queryable_composed_after_removing_whitespaces(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_queryable_composed_after_removing_whitespaces(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_queryable_composed_compiled_with_parameter(async: False) 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 55453cc..8ad1d7c 100644 --- a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt +++ b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt @@ -8975,24 +8975,46 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_com EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_complex_property(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_complex_property(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_struct_complex_property(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_entity_type_containing_struct_complex_property(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_property_in_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Concat_two_different_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Contains_over_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Contains_over_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Contains_over_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Contains_over_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_nested_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_property_inside_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_optional_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_optional_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_required_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_complex_type_on_required_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_optional_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_optional_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_required_navigation(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_complex_type_via_required_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_optional_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_optional_navigation(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_required_navigation(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Project_struct_complex_type_via_required_navigation(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type_Distinct(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type_Distinct(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type_Where(async: False) @@ -9001,18 +9023,44 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_com EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_nested_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_single_property_on_nested_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Distinct(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Distinct(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Where(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type_Where(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Select_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_constant(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_constant(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_parameter(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_parameter(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Struct_complex_type_equals_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Subquery_over_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_complex_property(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_complex_property(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_struct_complex_property(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_entity_type_containing_struct_complex_property(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_property_in_struct_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_complex_type(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_complex_type(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_struct_complex_type(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.ComplexTypeQueryJetTest.Union_two_different_struct_complex_type(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.CompositeKeysQueryJetTest.Projecting_collections_multi_level(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.CompositeKeysQueryJetTest.Projecting_collections_multi_level(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.CompositeKeysQueryJetTest.Projecting_multiple_collections_on_multiple_levels_no_explicit_ordering(async: False) @@ -14133,6 +14181,8 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_over_unary_scalarsubquery(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_over_unary_unary(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_over_unary_unary(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select_scalar(isAsync: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select_scalar(isAsync: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select(isAsync: False) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Select(isAsync: True) EntityFrameworkCore.Jet.FunctionalTests.Query.NorthwindSetOperationsQueryJetTest.Union_Take_Union_Take(isAsync: False) @@ -15408,6 +15458,7 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.OperatorsQueryJetTest.Negate_on_li 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.Can_have_required_owned_type_on_derived_type 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) @@ -15886,6 +15937,8 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Count_member_ov EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Count_member_over_IReadOnlyCollection_works(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Enum_with_value_converter_matching_take_value(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Enum_with_value_converter_matching_take_value(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Filter_on_nested_DTO_with_interface_gets_simplified_correctly(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Filter_on_nested_DTO_with_interface_gets_simplified_correctly(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Flattened_GroupJoin_on_interface_generic(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.Flattened_GroupJoin_on_interface_generic(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SimpleQueryJetTest.GroupBy_aggregate_on_right_side_of_join(async: False) @@ -15979,8 +16032,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_annota EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_annotations_do_not_affect_successive_calls(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_contains(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_contains(async: True) -EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_nullable_predicate(async: False) -EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_nullable_predicate(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_empty_predicate(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_empty_predicate(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_predicate(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_composed_with_predicate(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_does_not_parameterize_interpolated_string(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_does_not_parameterize_interpolated_string(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.SqlQueryJetTest.SqlQueryRaw_in_subquery_with_dbParameter(async: False) diff --git a/test/EFCore.Jet.FunctionalTests/Query/ComplexNavigationsQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/ComplexNavigationsQueryJetTest.cs index 7ea4c6f..9df1eba 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/ComplexNavigationsQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/ComplexNavigationsQueryJetTest.cs @@ -926,13 +926,13 @@ WHERE (`l1`.`Id` = `l2`.`Id` OR (`l1`.`Id` IS NULL AND `l2`.`Id` IS NULL)) AND ( await base.Complex_navigations_with_predicate_projected_into_anonymous_type2(isAsync); AssertSql( -""" + """ SELECT `l`.`Name`, `l2`.`Id` FROM ((`LevelThree` AS `l` INNER JOIN `LevelTwo` AS `l0` ON `l`.`Level2_Required_Id` = `l0`.`Id`) LEFT JOIN `LevelOne` AS `l1` ON `l0`.`Level1_Required_Id` = `l1`.`Id`) LEFT JOIN `LevelOne` AS `l2` ON `l0`.`Level1_Optional_Id` = `l2`.`Id` -WHERE (`l1`.`Id` = `l2`.`Id` AND (`l2`.`Id` <> 7 OR `l2`.`Id` IS NULL)) AND (`l0`.`Level1_Required_Id` IS NOT NULL AND `l1`.`Id` IS NOT NULL) +WHERE ((`l1`.`Id` <> `l2`.`Id` OR `l2`.`Id` IS NULL) AND (`l2`.`Id` <> 7 OR `l2`.`Id` IS NULL)) AND (`l0`.`Level1_Required_Id` IS NOT NULL AND `l1`.`Id` IS NOT NULL) """); } @@ -1441,7 +1441,7 @@ SELECT TOP 3 `l`.`Name` FROM (`LevelTwo` AS `l` INNER JOIN `LevelOne` AS `l0` ON `l`.`Level1_Required_Id` = `l0`.`Id`) LEFT JOIN `LevelThree` AS `l1` ON `l0`.`Id` = `l1`.`Level2_Required_Id` -WHERE (`l0`.`Name` = 'L1 03' AND `l1`.`Name` = 'L3 08') AND (`l0`.`Id` IS NOT NULL AND `l1`.`Level2_Required_Id` IS NOT NULL) +WHERE `l0`.`Id` IS NOT NULL AND `l1`.`Level2_Required_Id` IS NOT NULL ORDER BY `l0`.`Id` """); } @@ -1457,7 +1457,7 @@ SELECT TOP 3 `l0`.`Name` FROM (`LevelTwo` AS `l` INNER JOIN `LevelOne` AS `l0` ON `l`.`Level1_Required_Id` = `l0`.`Id`) LEFT JOIN `LevelThree` AS `l1` ON `l0`.`Id` = `l1`.`Level2_Required_Id` -WHERE (`l0`.`Name` = 'L1 03' AND `l1`.`Name` = 'L3 08') AND (`l0`.`Id` IS NOT NULL AND `l1`.`Level2_Required_Id` IS NOT NULL) +WHERE `l0`.`Id` IS NOT NULL AND `l1`.`Level2_Required_Id` IS NOT NULL ORDER BY `l0`.`Id` """); } @@ -1849,7 +1849,7 @@ WHERE 1 IN ( SELECT `l`.`Id`, `l`.`Date`, `l`.`Name`, `l`.`OneToMany_Optional_Self_Inverse1Id`, `l`.`OneToMany_Required_Self_Inverse1Id`, `l`.`OneToOne_Optional_Self1Id` FROM `LevelOne` AS `l` LEFT JOIN `LevelTwo` AS `l0` ON `l`.`Id` = `l0`.`Level1_Optional_Id` -WHERE 1 IN ( +WHERE 5 IN ( SELECT DISTINCT IIF(LEN(`l1`.`Name`) IS NULL, NULL, CLNG(LEN(`l1`.`Name`))) FROM `LevelThree` AS `l1` WHERE `l0`.`Id` IS NOT NULL AND `l0`.`Id` = `l1`.`OneToMany_Optional_Inverse3Id` @@ -1898,11 +1898,15 @@ WHERE `l`.`Id` = 7 """ SELECT `l`.`Id`, `l`.`Date`, `l`.`Level1_Optional_Id`, `l`.`Level1_Required_Id`, `l`.`Name`, `l`.`OneToMany_Optional_Inverse2Id`, `l`.`OneToMany_Optional_Self_Inverse2Id`, `l`.`OneToMany_Required_Inverse2Id`, `l`.`OneToMany_Required_Self_Inverse2Id`, `l`.`OneToOne_Optional_PK_Inverse2Id`, `l`.`OneToOne_Optional_Self2Id` FROM `LevelTwo` AS `l` -WHERE `l`.`Id` = 7 AND ( +WHERE `l`.`Id` = 7 AND (( SELECT TOP 1 `l1`.`Name` FROM `LevelTwo` AS `l0` INNER JOIN `LevelOne` AS `l1` ON `l0`.`Level1_Required_Id` = `l1`.`Id` - ORDER BY `l0`.`Id`) = 'L1 02' + ORDER BY `l0`.`Id`) = 'L1 10' OR ( + SELECT TOP 1 `l3`.`Name` + FROM `LevelTwo` AS `l2` + INNER JOIN `LevelOne` AS `l3` ON `l2`.`Level1_Required_Id` = `l3`.`Id` + ORDER BY `l2`.`Id`) = 'L1 01') """); } @@ -2359,7 +2363,7 @@ FROM ( FROM (`LevelThree` AS `l` INNER JOIN `LevelTwo` AS `l0` ON `l`.`OneToMany_Required_Inverse3Id` = `l0`.`Id`) LEFT JOIN `LevelOne` AS `l1` ON `l0`.`Level1_Required_Id` = `l1`.`Id` - WHERE (`l1`.`Name` = 'L1 03') AND (`l0`.`Level1_Required_Id` IS NOT NULL AND `l1`.`Id` IS NOT NULL) + WHERE (`l1`.`Name` IN ('L1 10', 'L1 01')) AND (`l0`.`Level1_Required_Id` IS NOT NULL AND `l1`.`Id` IS NOT NULL) ORDER BY `l`.`Level2_Required_Id` ) AS `t` ORDER BY `t`.`Level2_Required_Id` DESC @@ -3323,12 +3327,14 @@ FROM `LevelOne` AS `l` await base.Null_check_removal_applied_recursively(isAsync); AssertSql( - @"SELECT `l`.`Id`, `l`.`Date`, `l`.`Name`, `l`.`OneToMany_Optional_Self_Inverse1Id`, `l`.`OneToMany_Required_Self_Inverse1Id`, `l`.`OneToOne_Optional_Self1Id` + """ +SELECT `l`.`Id`, `l`.`Date`, `l`.`Name`, `l`.`OneToMany_Optional_Self_Inverse1Id`, `l`.`OneToMany_Required_Self_Inverse1Id`, `l`.`OneToOne_Optional_Self1Id` FROM ((`LevelOne` AS `l` LEFT JOIN `LevelTwo` AS `l0` ON `l`.`Id` = `l0`.`Level1_Optional_Id`) LEFT JOIN `LevelThree` AS `l1` ON `l0`.`Id` = `l1`.`Level2_Optional_Id`) -LEFT JOIN `LevelFour` AS `l2` ON `l1`.`Id` = `l2`.`Level3_Optional_Id` -WHERE `l2`.`Name` = 'L4 01'"); +LEFT JOIN `LevelFour` AS `l2` ON `l1`.`Id` = `l2`.`OneToOne_Optional_PK_Inverse4Id` +WHERE `l2`.`Name` = 'L4 01' +"""); } public override async Task Null_check_different_structure_does_not_remove_null_checks(bool isAsync) @@ -3336,12 +3342,14 @@ WHERE `l2`.`Name` = 'L4 01'"); await base.Null_check_different_structure_does_not_remove_null_checks(isAsync); AssertSql( - $@"SELECT `l`.`Id`, `l`.`Date`, `l`.`Name`, `l`.`OneToMany_Optional_Self_Inverse1Id`, `l`.`OneToMany_Required_Self_Inverse1Id`, `l`.`OneToOne_Optional_Self1Id` + """ +SELECT `l`.`Id`, `l`.`Date`, `l`.`Name`, `l`.`OneToMany_Optional_Self_Inverse1Id`, `l`.`OneToMany_Required_Self_Inverse1Id`, `l`.`OneToOne_Optional_Self1Id` FROM ((`LevelOne` AS `l` LEFT JOIN `LevelTwo` AS `l0` ON `l`.`Id` = `l0`.`Level1_Optional_Id`) LEFT JOIN `LevelThree` AS `l1` ON `l0`.`Id` = `l1`.`Level2_Optional_Id`) -LEFT JOIN `LevelFour` AS `l2` ON `l1`.`Id` = `l2`.`Level3_Optional_Id` -WHERE IIF(`l0`.`Id` IS NULL, NULL, IIF(`l1`.`Id` IS NULL, NULL, `l2`.`Name`)) = 'L4 01'"); +LEFT JOIN `LevelFour` AS `l2` ON `l1`.`Id` = `l2`.`OneToOne_Optional_PK_Inverse4Id` +WHERE IIF(`l0`.`Id` IS NULL, NULL, IIF(`l1`.`Id` IS NULL, NULL, `l2`.`Name`)) = 'L4 01' +"""); } public override async Task Union_over_entities_with_different_nullability(bool isAsync) @@ -3446,7 +3454,7 @@ WHERE `l`.`Id` > ( SELECT `l`.`Id`, `l`.`Date`, `l`.`Name`, `l`.`OneToMany_Optional_Self_Inverse1Id`, `l`.`OneToMany_Required_Self_Inverse1Id`, `l`.`OneToOne_Optional_Self1Id` FROM `LevelOne` AS `l` LEFT JOIN `LevelTwo` AS `l0` ON `l`.`Id` = `l0`.`Level1_Optional_Id` -WHERE `l`.`Id` = `l0`.`Id` +WHERE (`l`.`Id` + 7) = `l0`.`Id` """); } diff --git a/test/EFCore.Jet.FunctionalTests/Query/ComplexTypeQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/ComplexTypeQueryJetTest.cs index aee654e..03b6787 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/ComplexTypeQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/ComplexTypeQueryJetTest.cs @@ -389,6 +389,364 @@ FROM `Customer` AS `c0` AssertSql(); } + public override async Task Filter_on_property_inside_struct_complex_type(bool async) + { + await base.Filter_on_property_inside_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`ShippingAddress_ZipCode` = 7728 +"""); + } + + public override async Task Filter_on_property_inside_nested_struct_complex_type(bool async) + { + await base.Filter_on_property_inside_nested_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`ShippingAddress_Country_Code` = 'DE' +"""); + } + + public override async Task Filter_on_property_inside_struct_complex_type_after_subquery(bool async) + { + await base.Filter_on_property_inside_struct_complex_type_after_subquery(async); + + AssertSql( +""" +@__p_0='1' + +SELECT DISTINCT [t].[Id], [t].[Name], [t].[BillingAddress_AddressLine1], [t].[BillingAddress_AddressLine2], [t].[BillingAddress_ZipCode], [t].[BillingAddress_Country_Code], [t].[BillingAddress_Country_FullName], [t].[ShippingAddress_AddressLine1], [t].[ShippingAddress_AddressLine2], [t].[ShippingAddress_ZipCode], [t].[ShippingAddress_Country_Code], [t].[ShippingAddress_Country_FullName] +FROM ( + SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] + FROM [ValuedCustomer] AS [v] + ORDER BY [v].[Id] + OFFSET @__p_0 ROWS +) AS [t] +WHERE [t].[ShippingAddress_ZipCode] = 7728 +"""); + } + + public override async Task Filter_on_property_inside_nested_struct_complex_type_after_subquery(bool async) + { + await base.Filter_on_property_inside_nested_struct_complex_type_after_subquery(async); + + AssertSql( +""" +@__p_0='1' + +SELECT DISTINCT [t].[Id], [t].[Name], [t].[BillingAddress_AddressLine1], [t].[BillingAddress_AddressLine2], [t].[BillingAddress_ZipCode], [t].[BillingAddress_Country_Code], [t].[BillingAddress_Country_FullName], [t].[ShippingAddress_AddressLine1], [t].[ShippingAddress_AddressLine2], [t].[ShippingAddress_ZipCode], [t].[ShippingAddress_Country_Code], [t].[ShippingAddress_Country_FullName] +FROM ( + SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] + FROM [ValuedCustomer] AS [v] + ORDER BY [v].[Id] + OFFSET @__p_0 ROWS +) AS [t] +WHERE [t].[ShippingAddress_Country_Code] = N'DE' +"""); + } + + public override async Task Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(bool async) + { + await base.Filter_on_required_property_inside_required_struct_complex_type_on_optional_navigation(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`OptionalCustomerId`, `v`.`RequiredCustomerId`, `v0`.`Id`, `v0`.`Name`, `v0`.`BillingAddress_AddressLine1`, `v0`.`BillingAddress_AddressLine2`, `v0`.`BillingAddress_ZipCode`, `v0`.`BillingAddress_Country_Code`, `v0`.`BillingAddress_Country_FullName`, `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName`, `v1`.`Id`, `v1`.`Name`, `v1`.`BillingAddress_AddressLine1`, `v1`.`BillingAddress_AddressLine2`, `v1`.`BillingAddress_ZipCode`, `v1`.`BillingAddress_Country_Code`, `v1`.`BillingAddress_Country_FullName`, `v1`.`ShippingAddress_AddressLine1`, `v1`.`ShippingAddress_AddressLine2`, `v1`.`ShippingAddress_ZipCode`, `v1`.`ShippingAddress_Country_Code`, `v1`.`ShippingAddress_Country_FullName` +FROM (`ValuedCustomerGroup` AS `v` +LEFT JOIN `ValuedCustomer` AS `v0` ON `v`.`OptionalCustomerId` = `v0`.`Id`) +INNER JOIN `ValuedCustomer` AS `v1` ON `v`.`RequiredCustomerId` = `v1`.`Id` +WHERE `v0`.`ShippingAddress_ZipCode` <> 7728 OR `v0`.`ShippingAddress_ZipCode` IS NULL +"""); + } + + public override async Task Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(bool async) + { + await base.Filter_on_required_property_inside_required_struct_complex_type_on_required_navigation(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`OptionalCustomerId`, `v`.`RequiredCustomerId`, `v1`.`Id`, `v1`.`Name`, `v1`.`BillingAddress_AddressLine1`, `v1`.`BillingAddress_AddressLine2`, `v1`.`BillingAddress_ZipCode`, `v1`.`BillingAddress_Country_Code`, `v1`.`BillingAddress_Country_FullName`, `v1`.`ShippingAddress_AddressLine1`, `v1`.`ShippingAddress_AddressLine2`, `v1`.`ShippingAddress_ZipCode`, `v1`.`ShippingAddress_Country_Code`, `v1`.`ShippingAddress_Country_FullName`, `v0`.`Id`, `v0`.`Name`, `v0`.`BillingAddress_AddressLine1`, `v0`.`BillingAddress_AddressLine2`, `v0`.`BillingAddress_ZipCode`, `v0`.`BillingAddress_Country_Code`, `v0`.`BillingAddress_Country_FullName`, `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName` +FROM (`ValuedCustomerGroup` AS `v` +INNER JOIN `ValuedCustomer` AS `v0` ON `v`.`RequiredCustomerId` = `v0`.`Id`) +LEFT JOIN `ValuedCustomer` AS `v1` ON `v`.`OptionalCustomerId` = `v1`.`Id` +WHERE `v0`.`ShippingAddress_ZipCode` <> 7728 +"""); + } + + // EF Core problem itself. See same test in SQL Server + public override async Task Project_struct_complex_type_via_optional_navigation(bool async) + { + var exception = await Assert.ThrowsAsync(() => base.Project_struct_complex_type_via_optional_navigation(async)); + + Assert.Equal(RelationalStrings.CannotProjectNullableComplexType("ValuedCustomer.ShippingAddress#AddressStruct"), exception.Message); + } + + public override async Task Project_struct_complex_type_via_required_navigation(bool async) + { + await base.Project_struct_complex_type_via_required_navigation(async); + + AssertSql( + """ +SELECT `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomerGroup` AS `v` +INNER JOIN `ValuedCustomer` AS `v0` ON `v`.`RequiredCustomerId` = `v0`.`Id` +"""); + } + + public override async Task Load_struct_complex_type_after_subquery_on_entity_type(bool async) + { + await base.Load_struct_complex_type_after_subquery_on_entity_type(async); + + AssertSql( +""" +@__p_0='1' + +SELECT DISTINCT [t].[Id], [t].[Name], [t].[BillingAddress_AddressLine1], [t].[BillingAddress_AddressLine2], [t].[BillingAddress_ZipCode], [t].[BillingAddress_Country_Code], [t].[BillingAddress_Country_FullName], [t].[ShippingAddress_AddressLine1], [t].[ShippingAddress_AddressLine2], [t].[ShippingAddress_ZipCode], [t].[ShippingAddress_Country_Code], [t].[ShippingAddress_Country_FullName] +FROM ( + SELECT [v].[Id], [v].[Name], [v].[BillingAddress_AddressLine1], [v].[BillingAddress_AddressLine2], [v].[BillingAddress_ZipCode], [v].[BillingAddress_Country_Code], [v].[BillingAddress_Country_FullName], [v].[ShippingAddress_AddressLine1], [v].[ShippingAddress_AddressLine2], [v].[ShippingAddress_ZipCode], [v].[ShippingAddress_Country_Code], [v].[ShippingAddress_Country_FullName] + FROM [ValuedCustomer] AS [v] + ORDER BY [v].[Id] + OFFSET @__p_0 ROWS +) AS [t] +"""); + } + + public override async Task Select_struct_complex_type(bool async) + { + await base.Select_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +"""); + } + + public override async Task Select_nested_struct_complex_type(bool async) + { + await base.Select_nested_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +"""); + } + + public override async Task Select_single_property_on_nested_struct_complex_type(bool async) + { + await base.Select_single_property_on_nested_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +"""); + } + + public override async Task Select_struct_complex_type_Where(bool async) + { + await base.Select_struct_complex_type_Where(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`ShippingAddress_ZipCode` = 7728 +"""); + } + + public override async Task Select_struct_complex_type_Distinct(bool async) + { + await base.Select_struct_complex_type_Distinct(async); + + AssertSql( + """ +SELECT DISTINCT `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +"""); + } + + public override async Task Struct_complex_type_equals_struct_complex_type(bool async) + { + await base.Struct_complex_type_equals_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`ShippingAddress_AddressLine1` = `v`.`BillingAddress_AddressLine1` AND (`v`.`ShippingAddress_AddressLine2` = `v`.`BillingAddress_AddressLine2` OR (`v`.`ShippingAddress_AddressLine2` IS NULL AND `v`.`BillingAddress_AddressLine2` IS NULL)) AND `v`.`ShippingAddress_ZipCode` = `v`.`BillingAddress_ZipCode` +"""); + } + + public override async Task Struct_complex_type_equals_constant(bool async) + { + await base.Struct_complex_type_equals_constant(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`ShippingAddress_AddressLine1` = '804 S. Lakeshore Road' AND `v`.`ShippingAddress_AddressLine2` IS NULL AND `v`.`ShippingAddress_ZipCode` = 38654 AND `v`.`ShippingAddress_Country_Code` = 'US' AND `v`.`ShippingAddress_Country_FullName` = 'United States' +"""); + } + + public override async Task Struct_complex_type_equals_parameter(bool async) + { + await base.Struct_complex_type_equals_parameter(async); + + AssertSql( + """ +@__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' (Size = 255) +@__entity_equality_address_0_ZipCode='38654' (Nullable = true) +@__entity_equality_address_0_Code='US' (Size = 255) +@__entity_equality_address_0_FullName='United States' (Size = 255) + +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`ShippingAddress_AddressLine1` = @__entity_equality_address_0_AddressLine1 AND `v`.`ShippingAddress_AddressLine2` IS NULL AND `v`.`ShippingAddress_ZipCode` = @__entity_equality_address_0_ZipCode AND `v`.`ShippingAddress_Country_Code` = @__entity_equality_address_0_Code AND `v`.`ShippingAddress_Country_FullName` = @__entity_equality_address_0_FullName +"""); + } + + public override async Task Subquery_over_struct_complex_type(bool async) + { + await base.Subquery_over_struct_complex_type(async); + + AssertSql(); + } + + public override async Task Contains_over_struct_complex_type(bool async) + { + await base.Contains_over_struct_complex_type(async); + + AssertSql( + """ +@__entity_equality_address_0_AddressLine1='804 S. Lakeshore Road' (Size = 255) +@__entity_equality_address_0_ZipCode='38654' (Nullable = true) +@__entity_equality_address_0_Code='US' (Size = 255) +@__entity_equality_address_0_FullName='United States' (Size = 255) + +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE EXISTS ( + SELECT 1 + FROM `ValuedCustomer` AS `v0` + WHERE `v0`.`ShippingAddress_AddressLine1` = @__entity_equality_address_0_AddressLine1 AND `v0`.`ShippingAddress_AddressLine2` IS NULL AND `v0`.`ShippingAddress_ZipCode` = @__entity_equality_address_0_ZipCode AND `v0`.`ShippingAddress_Country_Code` = @__entity_equality_address_0_Code AND `v0`.`ShippingAddress_Country_FullName` = @__entity_equality_address_0_FullName) +"""); + } + + public override async Task Concat_struct_complex_type(bool async) + { + await base.Concat_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`Id` = 1 +UNION ALL +SELECT `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v0` +WHERE `v0`.`Id` = 2 +"""); + } + + public override async Task Concat_entity_type_containing_struct_complex_property(bool async) + { + await base.Concat_entity_type_containing_struct_complex_property(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`Id` = 1 +UNION ALL +SELECT `v0`.`Id`, `v0`.`Name`, `v0`.`BillingAddress_AddressLine1`, `v0`.`BillingAddress_AddressLine2`, `v0`.`BillingAddress_ZipCode`, `v0`.`BillingAddress_Country_Code`, `v0`.`BillingAddress_Country_FullName`, `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v0` +WHERE `v0`.`Id` = 2 +"""); + } + + public override async Task Union_entity_type_containing_struct_complex_property(bool async) + { + await base.Union_entity_type_containing_struct_complex_property(async); + + AssertSql( + """ +SELECT `v`.`Id`, `v`.`Name`, `v`.`BillingAddress_AddressLine1`, `v`.`BillingAddress_AddressLine2`, `v`.`BillingAddress_ZipCode`, `v`.`BillingAddress_Country_Code`, `v`.`BillingAddress_Country_FullName`, `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`Id` = 1 +UNION +SELECT `v0`.`Id`, `v0`.`Name`, `v0`.`BillingAddress_AddressLine1`, `v0`.`BillingAddress_AddressLine2`, `v0`.`BillingAddress_ZipCode`, `v0`.`BillingAddress_Country_Code`, `v0`.`BillingAddress_Country_FullName`, `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v0` +WHERE `v0`.`Id` = 2 +"""); + } + + public override async Task Union_struct_complex_type(bool async) + { + await base.Union_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_AddressLine1`, `v`.`ShippingAddress_AddressLine2`, `v`.`ShippingAddress_ZipCode`, `v`.`ShippingAddress_Country_Code`, `v`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v` +WHERE `v`.`Id` = 1 +UNION +SELECT `v0`.`ShippingAddress_AddressLine1`, `v0`.`ShippingAddress_AddressLine2`, `v0`.`ShippingAddress_ZipCode`, `v0`.`ShippingAddress_Country_Code`, `v0`.`ShippingAddress_Country_FullName` +FROM `ValuedCustomer` AS `v0` +WHERE `v0`.`Id` = 2 +"""); + } + + public override async Task Concat_property_in_struct_complex_type(bool async) + { + await base.Concat_property_in_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_AddressLine1` +FROM `ValuedCustomer` AS `v` +UNION ALL +SELECT `v0`.`BillingAddress_AddressLine1` AS `ShippingAddress_AddressLine1` +FROM `ValuedCustomer` AS `v0` +"""); + } + + public override async Task Union_property_in_struct_complex_type(bool async) + { + await base.Union_property_in_struct_complex_type(async); + + AssertSql( + """ +SELECT `v`.`ShippingAddress_AddressLine1` +FROM `ValuedCustomer` AS `v` +UNION +SELECT `v0`.`BillingAddress_AddressLine1` AS `ShippingAddress_AddressLine1` +FROM `ValuedCustomer` AS `v0` +"""); + } + + public override async Task Concat_two_different_struct_complex_type(bool async) + { + await base.Concat_two_different_struct_complex_type(async); + + AssertSql(); + } + + public override async Task Union_two_different_struct_complex_type(bool async) + { + await base.Union_two_different_struct_complex_type(async); + + AssertSql(); + } + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.Jet.FunctionalTests/Query/FunkyDataQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/FunkyDataQueryJetTest.cs index 5bfe64d..b653855 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/FunkyDataQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/FunkyDataQueryJetTest.cs @@ -166,7 +166,7 @@ WHERE NOT (`f`.`FirstName` IS NOT NULL AND `f0`.`LastName` IS NOT NULL AND (INST await base.String_starts_with_on_argument_with_wildcard_constant(isAsync); AssertSql( -""" + """ SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` WHERE `f`.`FirstName` LIKE '[%]B%' @@ -175,7 +175,7 @@ WHERE `f`.`FirstName` LIKE '[%]B%' """ SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` -WHERE `f`.`FirstName` LIKE 'a[_]%' +WHERE `f`.`FirstName` LIKE '[_]B%' """, // """ @@ -228,7 +228,7 @@ WHERE `f`.`FirstName` LIKE @__prm1_0_rewritten """, // """ -@__prm2_0_rewritten='a[_]%' (Size = 255) +@__prm2_0_rewritten='[_]B%' (Size = 255) SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` @@ -364,16 +364,16 @@ WHERE `f`.`FirstName` IS NULL OR `f0`.`LastName` IS NULL OR LEFT(`f`.`FirstName` await base.String_ends_with_on_argument_with_wildcard_constant(isAsync); AssertSql( -""" + """ SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` -WHERE `f`.`FirstName` LIKE '%[%]B' +WHERE `f`.`FirstName` LIKE '%[%]r' """, // """ SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` -WHERE `f`.`FirstName` LIKE '%a[_]' +WHERE `f`.`FirstName` LIKE '%r[_]' """, // """ @@ -391,13 +391,13 @@ WHERE `f`.`FirstName` IS NOT NULL """ SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` -WHERE `f`.`FirstName` LIKE '%[_]Ba[_]' +WHERE `f`.`FirstName` LIKE '%[_]r[_]' """, // """ SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` -WHERE `f`.`FirstName` NOT LIKE '%[%]B[%]a[%]r' OR `f`.`FirstName` IS NULL +WHERE `f`.`FirstName` NOT LIKE '%a[%]r[%]' OR `f`.`FirstName` IS NULL """, // """ @@ -418,7 +418,7 @@ FROM `FunkyCustomers` AS `f` AssertSql( """ -@__prm1_0_rewritten='%[%]B' (Size = 255) +@__prm1_0_rewritten='%[%]r' (Size = 255) SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` @@ -426,7 +426,7 @@ WHERE `f`.`FirstName` LIKE @__prm1_0_rewritten """, // """ -@__prm2_0_rewritten='%a[_]' (Size = 255) +@__prm2_0_rewritten='%r[_]' (Size = 255) SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` @@ -448,7 +448,7 @@ WHERE `f`.`FirstName` LIKE @__prm4_0_rewritten """, // """ -@__prm5_0_rewritten='%[_]Ba[_]' (Size = 255) +@__prm5_0_rewritten='%[_]r[_]' (Size = 255) SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` @@ -456,7 +456,7 @@ WHERE `f`.`FirstName` LIKE @__prm5_0_rewritten """, // """ -@__prm6_0_rewritten='%[%]B[%]a[%]r' (Size = 255) +@__prm6_0_rewritten='%a[%]r[%]' (Size = 255) SELECT `f`.`FirstName` FROM `FunkyCustomers` AS `f` diff --git a/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs index ab5bff0..25f3e66 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs @@ -2806,7 +2806,7 @@ FROM (SELECT COUNT(*) FROM `#Dual`) """ SELECT `t`.`Id`, `t`.`GearNickName`, `t`.`GearSquadId`, `t`.`IssueDate`, `t`.`Note` FROM `Tags` AS `t` -WHERE `t`.`Id` IN ('{d2c26679-562b-44d1-ab96-23d1775e0926}', '{23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3}', '{ab1b82d7-88db-42bd-a132-7eef9aa68af4}') +WHERE `t`.`Id` IN ('{df36f493-463f-4123-83f9-6b135deeb7ba}', '{23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3}', '{ab1b82d7-88db-42bd-a132-7eef9aa68af4}') """); } @@ -7066,19 +7066,19 @@ FROM `Gears` AS `g` await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(isAsync); AssertSql( -""" -SELECT `f`.`Id`, `f`.`CapitalName`, `f`.`Discriminator`, `f`.`Name`, `f`.`ServerAddress`, `f`.`CommanderName`, `f`.`Eradicated` -FROM `Factions` AS `f` -LEFT JOIN `Cities` AS `c` ON `f`.`CapitalName` = `c`.`Name` + """ +SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`Discriminator`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank` +FROM `Gears` AS `g` +LEFT JOIN `Cities` AS `c` ON `g`.`AssignedCityName` = `c`.`Name` WHERE `c`.`Name` = ( SELECT TOP 1 `c0`.`Name` - FROM `Gears` AS `g` - INNER JOIN `Cities` AS `c0` ON `g`.`CityOfBirthName` = `c0`.`Name` - ORDER BY `g`.`Nickname`) OR (`c`.`Name` IS NULL AND ( + FROM `Gears` AS `g0` + INNER JOIN `Cities` AS `c0` ON `g0`.`CityOfBirthName` = `c0`.`Name` + ORDER BY `g0`.`Nickname`) OR (`c`.`Name` IS NULL AND ( SELECT TOP 1 `c0`.`Name` - FROM `Gears` AS `g` - INNER JOIN `Cities` AS `c0` ON `g`.`CityOfBirthName` = `c0`.`Name` - ORDER BY `g`.`Nickname`) IS NULL) + FROM `Gears` AS `g0` + INNER JOIN `Cities` AS `c0` ON `g0`.`CityOfBirthName` = `c0`.`Name` + ORDER BY `g0`.`Nickname`) IS NULL) """); } @@ -7303,9 +7303,9 @@ WHERE DATALENGTH(`s`.`Banner5`) = 5 await base.Conditional_expression_with_test_being_simplified_to_constant_complex(isAsync); AssertSql( -""" + """ @__prm_0='True' -@__prm2_1='Dom's Lancer' (Size = 255) +@__prm2_1='Marcus' Lancer' (Size = 255) SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`Discriminator`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank` FROM `Gears` AS `g` @@ -7438,10 +7438,10 @@ WHERE CBYTE(`l`.`ThreatLevel`) >= CBYTE(5) AssertSql( """ - SELECT `l`.`Name`, `l`.`Discriminator`, `l`.`LocustHordeId`, `l`.`ThreatLevel`, `l`.`ThreatLevelByte`, `l`.`ThreatLevelNullableByte`, `l`.`DefeatedByNickname`, `l`.`DefeatedBySquadId`, `l`.`HighCommandId` - FROM `LocustLeaders` AS `l` - WHERE CLNG(`l`.`ThreatLevel`) >= (5 + CLNG(`l`.`ThreatLevel`)) - """); +SELECT `l`.`Name`, `l`.`Discriminator`, `l`.`LocustHordeId`, `l`.`ThreatLevel`, `l`.`ThreatLevelByte`, `l`.`ThreatLevelNullableByte`, `l`.`DefeatedByNickname`, `l`.`DefeatedBySquadId`, `l`.`HighCommandId` +FROM `LocustLeaders` AS `l` +WHERE CLNG(`l`.`ThreatLevel`) <= (5 + CLNG(`l`.`ThreatLevel`)) +"""); } public override async Task TimeSpan_Hours(bool async) @@ -7508,7 +7508,7 @@ WHERE DATEPART('h', `m`.`Duration`) = 1 """ SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Date`, `m`.`Duration`, `m`.`Rating`, `m`.`Time`, `m`.`Timeline` FROM `Missions` AS `m` -WHERE DATEPART('n', `m`.`Duration`) = 1 +WHERE DATEPART('n', `m`.`Duration`) = 2 """); } @@ -7520,7 +7520,7 @@ WHERE DATEPART('n', `m`.`Duration`) = 1 """ SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Date`, `m`.`Duration`, `m`.`Rating`, `m`.`Time`, `m`.`Timeline` FROM `Missions` AS `m` -WHERE DATEPART('s', `m`.`Duration`) = 1 +WHERE DATEPART('s', `m`.`Duration`) = 3 """); } @@ -7926,16 +7926,18 @@ ORDER BY `g`.`Nickname`, `t`.`Id` await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT `s`.`Name` FROM `Squads` AS `s` -WHERE `s`.`Name` = 'Kilo' AND IIF(( +WHERE `s`.`Name` = 'Delta' AND IIF(( SELECT TOP 1 `g`.`SquadId` FROM `Gears` AS `g` - WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE) IS NULL, 0, ( + WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE + ORDER BY `g`.`FullName`) IS NULL, 0, ( SELECT TOP 1 `g`.`SquadId` FROM `Gears` AS `g` - WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE)) <> 0 + WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE + ORDER BY `g`.`FullName`)) <> 0 """); } @@ -8855,9 +8857,8 @@ WHERE `g`.`HasSoulPatch` = TRUE AND `g`.`HasSoulPatch` IN (FALSE, TRUE) AssertSql( """ -@__place_0='Seattle' (Size = 255) -@__place_0_1='Seattle' (Size = 100) -@__place_0_1='Seattle' (Size = 100) +@__place_0='Ephyra's location' (Size = 255), @__place_0_1='Ephyra's location' (Size = 100) +@__place_0_1='Ephyra's location' (Size = 100) SELECT `c`.`Name`, `c`.`Location`, `c`.`Nation` FROM `Cities` AS `c` @@ -9345,6 +9346,21 @@ WHERE NOT EXISTS ( """); } + public override async Task Where_subquery_equality_to_null_with_composite_key_should_match_nulls(bool async) + { + await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); + + AssertSql( + """ +SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] +FROM [Squads] AS [s] +WHERE NOT EXISTS ( + SELECT 1 + FROM [Gears] AS [g] + WHERE [s].[Id] = [g].[SquadId] AND [g].[FullName] = N'Anthony Carmine') +"""); + } + public override async Task Where_subquery_equality_to_null_without_composite_key(bool async) { await base.Where_subquery_equality_to_null_without_composite_key(async); @@ -9360,6 +9376,21 @@ WHERE NOT EXISTS ( """); } + public override async Task Where_subquery_equality_to_null_without_composite_key_should_match_null(bool async) + { + await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); + + AssertSql( + """ +SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank] +FROM [Gears] AS [g] +WHERE NOT EXISTS ( + SELECT 1 + FROM [Weapons] AS [w] + WHERE [g].[FullName] = [w].[OwnerFullName] AND [w].[Name] = N'Hammer of Dawn') +"""); + } + public override async Task Include_reference_on_derived_type_using_EF_Property(bool async) { await base.Include_reference_on_derived_type_using_EF_Property(async); diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindFunctionsQueryJetTest.Functions.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindFunctionsQueryJetTest.Functions.cs index 1007704..5d5e737 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindFunctionsQueryJetTest.Functions.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindFunctionsQueryJetTest.Functions.cs @@ -215,8 +215,7 @@ WHERE `c`.`ContactName` LIKE '%m' await AssertQuery( isAsync, ss => ss.Set().Where(c => c.ContactName.Contains("M")), // case-insensitive - ss => ss.Set().Where(c => c.ContactName.Contains("M") || c.ContactName.Contains("m")), // case-sensitive - entryCount: 34); + ss => ss.Set().Where(c => c.ContactName.Contains("M") || c.ContactName.Contains("m"))); // case-sensitive AssertSql( """ @@ -305,8 +304,7 @@ WHERE MID(`c`.`ContactName`, IIF(IIF(LEN(`c`.`ContactName`) = 0, 1, LEN(`c`.`Con ss => ss.Set().Where(c => c.ContactName.Contains(LocalMethod1())), // case-insensitive ss => ss.Set().Where( c => c.ContactName.Contains(LocalMethod1().ToLower()) - || c.ContactName.Contains(LocalMethod1().ToUpper())), // case-sensitive - entryCount: 34); + || c.ContactName.Contains(LocalMethod1().ToUpper()))); // case-sensitive AssertSql( $@"SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` @@ -1616,8 +1614,7 @@ WHERE `o`.`CustomerID` = 'ALFKI' AND CONVERT(bit, CONVERT(bigint, `o`.`OrderID` await AssertQuery( isAsync, ss => ss.Set().Where(o => o.CustomerID == "ALFKI") - .Where(convertMethod), - entryCount: 6); + .Where(convertMethod)); } AssertSql( @@ -1669,8 +1666,7 @@ WHERE (`o`.`CustomerID` = 'ALFKI') AND (IIF((`o`.`OrderID` MOD 1 & '') IS NULL, await AssertQuery( isAsync, ss => ss.Set().Where(o => o.CustomerID == "ALFKI") - .Where(convertMethod), - entryCount: 6); + .Where(convertMethod)); } AssertSql( @@ -1722,8 +1718,7 @@ WHERE (`o`.`CustomerID` = 'ALFKI') AND (IIF((`o`.`OrderID` MOD 1 & '') IS NULL, await AssertQuery( isAsync, ss => ss.Set().Where(o => o.CustomerID == "ALFKI") - .Where(convertMethod), - entryCount: 6); + .Where(convertMethod)); } AssertSql( @@ -1775,8 +1770,7 @@ WHERE (`o`.`CustomerID` = 'ALFKI') AND (IIF((`o`.`OrderID` MOD 1 & '') IS NULL, await AssertQuery( isAsync, ss => ss.Set().Where(o => o.CustomerID == "ALFKI") - .Where(convertMethod), - entryCount: 6); + .Where(convertMethod)); } AssertSql( @@ -1828,8 +1822,7 @@ WHERE (`o`.`CustomerID` = 'ALFKI') AND (IIF((`o`.`OrderID` MOD 1 & '') IS NULL, await AssertQuery( isAsync, ss => ss.Set().Where(o => o.CustomerID == "ALFKI") - .Where(convertMethod), - entryCount: 6); + .Where(convertMethod)); } AssertSql( @@ -1921,8 +1914,7 @@ WHERE (`o`.`CustomerID` = 'ALFKI') AND (CONVERT(bigint, CONVERT(nvarchar(max), ` await AssertQuery( isAsync, ss => ss.Set().Where(o => o.CustomerID == "ALFKI") - .Where(convertMethod), - entryCount: 6); + .Where(convertMethod)); } AssertSql( diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs index f594be7..9d3c787 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindJoinQueryJetTest.cs @@ -102,7 +102,7 @@ INNER JOIN ( FROM `Orders` AS `o` ORDER BY `o`.`OrderID` ) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` -WHERE `t`.`CustomerID` = 'ALFKI'"); +WHERE `t`.`CustomerID` = 'HANAR'"); } public override async Task Join_customers_orders_with_subquery_anonymous_property_method(bool isAsync) @@ -131,7 +131,7 @@ WHERE `o`.`CustomerID` = 'ALFKI' FROM `Orders` AS `o` ORDER BY `o`.`OrderID` ) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` - WHERE `t`.`CustomerID` = 'ALFKI' + WHERE `t`.`CustomerID` = 'HANAR' """); } @@ -164,7 +164,7 @@ WHERE `t`.`CustomerID` = 'ALFKI'"); WHERE `o`.`OrderID` > 0 ORDER BY `o`.`OrderID` ) AS `t` ON `c`.`CustomerID` = `t`.`CustomerID` - WHERE `t`.`CustomerID` = 'ALFKI' + WHERE `t`.`CustomerID` = 'HANAR' """); } diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs index 6a46a0b..acb55f2 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindMiscellaneousQueryJetTest.cs @@ -641,13 +641,14 @@ WHERE ( await base.Where_query_composition_entity_equality_multiple_elements_SingleOrDefault(isAsync); AssertSql( -""" + """ SELECT `e`.`EmployeeID`, `e`.`City`, `e`.`Country`, `e`.`FirstName`, `e`.`ReportsTo`, `e`.`Title` FROM `Employees` AS `e` WHERE ( SELECT TOP 1 `e0`.`EmployeeID` FROM `Employees` AS `e0` - WHERE `e0`.`EmployeeID` <> `e`.`ReportsTo` OR `e`.`ReportsTo` IS NULL) = 0 + WHERE `e0`.`EmployeeID` <> `e`.`ReportsTo` OR `e`.`ReportsTo` IS NULL + ORDER BY `e0`.`EmployeeID`) = 1 """); } @@ -1422,7 +1423,7 @@ FROM `Customers` AS `c` WHERE (`c`.`City` <> 'London' OR `c`.`City` IS NULL) AND NOT EXISTS ( SELECT 1 FROM `Orders` AS `o` - WHERE `o`.`CustomerID` LIKE 'A%') + WHERE `o`.`CustomerID` LIKE 'ABC%') """); } @@ -1437,7 +1438,7 @@ FROM `Customers` AS `c` WHERE NOT EXISTS ( SELECT 1 FROM `Orders` AS `o` - WHERE `o`.`CustomerID` LIKE 'A%') AND (`c`.`City` <> 'London' OR `c`.`City` IS NULL) + WHERE `o`.`CustomerID` LIKE 'ABC%') AND (`c`.`City` <> 'London' OR `c`.`City` IS NULL) """); } @@ -1742,12 +1743,14 @@ WHERE `c`.`CustomerID` = 'ALFKI'"); await base.Where_Join_Any(isAsync); AssertSql( - $@"SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` + """ +SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` -WHERE `c`.`CustomerID` = 'ALFKI' AND EXISTS ( +WHERE (`c`.`CustomerID` LIKE 'A%') AND EXISTS ( SELECT 1 FROM `Orders` AS `o` - WHERE `c`.`CustomerID` = `o`.`CustomerID` AND `o`.`OrderDate` = #2008-10-24#)"); + WHERE `c`.`CustomerID` = `o`.`CustomerID` AND `o`.`OrderDate` = #1998-01-15#) +"""); } public override async Task Where_Join_Exists(bool isAsync) @@ -3135,7 +3138,7 @@ ORDER BY `t0`.`c` """ SELECT `o`.`CustomerID` FROM `Orders` AS `o` -WHERE `o`.`OrderDate` IS NOT NULL AND ((`o`.`EmployeeID` & '') LIKE '%10%') +WHERE `o`.`OrderDate` IS NOT NULL AND ((`o`.`EmployeeID` & '') LIKE '%7%') """); } @@ -5239,7 +5242,7 @@ SELECT `t`.`c` FROM ( SELECT DISTINCT DATEPART('yyyy', `o`.`OrderDate`) AS `c` FROM `Orders` AS `o` - WHERE `o`.`OrderID` < 10000 + WHERE `o`.`OrderID` < 20000 ) AS `t` """); } diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs index a570534..b268fc7 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindSetOperationsQueryJetTest.cs @@ -270,14 +270,16 @@ WHERE `t`.`Address` LIKE '%Hanover%'"); await base.Union_Select_scalar(isAsync); AssertSql( - $@"SELECT 1 + """ +SELECT 1 FROM ( SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` - EXCEPT + UNION SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` FROM `Customers` AS `c0` -) AS `t`"); +) AS `t` +"""); } public override async Task Union_with_anonymous_type_projection(bool isAsync) diff --git a/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs index f0f8cb8..ca336b7 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs @@ -894,7 +894,7 @@ WHERE DATEPART('d', `o`.`OrderDate`) = 4"); AssertSql( $@"SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` -WHERE DATEPART('h', `o`.`OrderDate`) = 14"); +WHERE DATEPART('h', `o`.`OrderDate`) = 0"); } public override async Task Where_datetime_minute_component(bool isAsync) @@ -904,7 +904,7 @@ WHERE DATEPART('h', `o`.`OrderDate`) = 14"); AssertSql( $@"SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` -WHERE DATEPART('n', `o`.`OrderDate`) = 23"); +WHERE DATEPART('n', `o`.`OrderDate`) = 0"); } public override async Task Where_datetime_second_component(bool isAsync) @@ -914,7 +914,7 @@ WHERE DATEPART('n', `o`.`OrderDate`) = 23"); AssertSql( $@"SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` -WHERE DATEPART('s', `o`.`OrderDate`) = 44"); +WHERE DATEPART('s', `o`.`OrderDate`) = 0"); } public override async Task Where_datetime_millisecond_component(bool isAsync) @@ -964,7 +964,7 @@ WHERE 'London' = `c`.`City`"); AssertSql( $@"SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` -WHERE `c`.`City` IS NULL"); +WHERE `c`.`Region` IS NULL"); } public override async Task Where_null_is_null(bool isAsync) @@ -1448,7 +1448,7 @@ WHERE ((`o`.`OrderID` & '') & IIF(`o`.`CustomerID` IS NULL, '', `o`.`CustomerID` SELECT `c`.`CustomerID` FROM `Customers` AS `c` - WHERE (@__i_0 & `c`.`CustomerID`) = `c`.`CompanyName` + WHERE (@__i_0 & `c`.`CustomerID`) = 'AALFKI' """); } @@ -1462,7 +1462,7 @@ WHERE ((`o`.`OrderID` & '') & IIF(`o`.`CustomerID` IS NULL, '', `o`.`CustomerID` SELECT `c`.`CustomerID` FROM `Customers` AS `c` - WHERE (@__i_0 & `c`.`CustomerID`) = `c`.`CompanyName` + WHERE (@__i_0 & `c`.`CustomerID`) = 'AAROUT' """); } @@ -1477,7 +1477,7 @@ WHERE ((`o`.`OrderID` & '') & IIF(`o`.`CustomerID` IS NULL, '', `o`.`CustomerID` SELECT `c`.`CustomerID` FROM `Customers` AS `c` -WHERE (@__i_0 & (@__j_1 & `c`.`CustomerID`)) = `c`.`CompanyName` +WHERE (@__i_0 & (@__j_1 & `c`.`CustomerID`)) = 'ABANATR' """); } @@ -1493,7 +1493,7 @@ WHERE (@__i_0 & (@__j_1 & `c`.`CustomerID`)) = `c`.`CompanyName` SELECT `c`.`CustomerID` FROM `Customers` AS `c` -WHERE (@__i_0 & (@__j_1 & (@__k_2 & `c`.`CustomerID`))) = `c`.`CompanyName` +WHERE (@__i_0 & (@__j_1 & (@__k_2 & `c`.`CustomerID`))) = 'ABCANTON' """); } @@ -1631,7 +1631,7 @@ WHERE 0 = 1"); """ SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` -WHERE `c`.`City` IS NULL AND `c`.`Country` = 'UK' +WHERE `c`.`Region` IS NULL AND `c`.`Country` = 'UK' """); } @@ -1643,7 +1643,7 @@ WHERE `c`.`City` IS NULL AND `c`.`Country` = 'UK' """ SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` -WHERE `c`.`City` IS NULL +WHERE `c`.`Region` IS NULL """); } @@ -1798,7 +1798,7 @@ WHERE ( SELECT TOP 1 `o`.`OrderID` FROM `Orders` AS `o` WHERE `c`.`CustomerID` = `o`.`CustomerID` - ORDER BY `o`.`OrderID`) = 10243"); + ORDER BY `o`.`OrderID`) = 10276"); } public override async Task Time_of_day_datetime(bool isAsync) @@ -1837,13 +1837,13 @@ WHERE 0 = 1"); await base.Enclosing_class_settable_member_generates_parameter(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__SettableProperty_0='4'")} + $@"{AssertSqlHelper.Declaration("@__SettableProperty_0='10274'")} SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` WHERE `o`.`OrderID` = {AssertSqlHelper.Parameter("@__SettableProperty_0")}", // - $@"{AssertSqlHelper.Declaration("@__SettableProperty_0='10'")} + $@"{AssertSqlHelper.Declaration("@__SettableProperty_0='10275'")} SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` @@ -1855,7 +1855,7 @@ WHERE `o`.`OrderID` = {AssertSqlHelper.Parameter("@__SettableProperty_0")}"); await base.Enclosing_class_readonly_member_generates_parameter(isAsync); AssertSql( - $@"{AssertSqlHelper.Declaration("@__ReadOnlyProperty_0='5'")} + $@"{AssertSqlHelper.Declaration("@__ReadOnlyProperty_0='10275'")} SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` @@ -1869,7 +1869,7 @@ WHERE `o`.`OrderID` = {AssertSqlHelper.Parameter("@__ReadOnlyProperty_0")}"); AssertSql( $@"SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` -WHERE `o`.`OrderID` = 1"); +WHERE `o`.`OrderID` = 10274"); } public override async Task Generic_Ilist_contains_translates_to_server(bool isAsync) @@ -1928,7 +1928,7 @@ WHERE (`o`.`OrderID` & '') LIKE '%20%'"); SELECT `c`.`CustomerID` FROM `Customers` AS `c` - WHERE (((@__i_0 & '') & `c`.`CustomerID`) & (@__i_0 & '')) = `c`.`CompanyName` + WHERE (((@__i_0 & '') & `c`.`CustomerID`) & (@__i_0 & '')) = '10ALFKI10' """); } @@ -2094,7 +2094,7 @@ LEFT JOIN `Order Details` AS `o1` ON `o`.`OrderID` = `o1`.`OrderID` WHERE `o`.`OrderID` < 10300 AND ( SELECT COUNT(*) FROM `Order Details` AS `o0` - WHERE `o`.`OrderID` = `o0`.`OrderID`) = 0 + WHERE `o`.`OrderID` = `o0`.`OrderID`) = 4 ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); } @@ -2128,7 +2128,7 @@ LEFT JOIN `Order Details` AS `o1` ON `o`.`OrderID` = `o1`.`OrderID` WHERE `o`.`OrderID` < 10300 AND ( SELECT COUNT(*) FROM `Order Details` AS `o0` - WHERE `o`.`OrderID` = `o0`.`OrderID`) = 0 + WHERE `o`.`OrderID` = `o0`.`OrderID`) = 4 ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); } @@ -2162,7 +2162,7 @@ LEFT JOIN `Order Details` AS `o1` ON `o`.`OrderID` = `o1`.`OrderID` WHERE `o`.`OrderID` < 10300 AND ( SELECT COUNT(*) FROM `Order Details` AS `o0` - WHERE `o`.`OrderID` = `o0`.`OrderID`) = 0 + WHERE `o`.`OrderID` = `o0`.`OrderID`) = 5 ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); } @@ -2196,7 +2196,7 @@ LEFT JOIN `Order Details` AS `o1` ON `o`.`OrderID` = `o1`.`OrderID` WHERE `o`.`OrderID` < 10300 AND ( SELECT COUNT(*) FROM `Order Details` AS `o0` - WHERE `o`.`OrderID` = `o0`.`OrderID`) = 0 + WHERE `o`.`OrderID` = `o0`.`OrderID`) = 3 ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); } @@ -2211,7 +2211,7 @@ LEFT JOIN `Order Details` AS `o1` ON `o`.`OrderID` = `o1`.`OrderID` WHERE `o`.`OrderID` < 10300 AND ( SELECT COUNT(*) FROM `Order Details` AS `o0` - WHERE `o`.`OrderID` = `o0`.`OrderID`) = 0 + WHERE `o`.`OrderID` = `o0`.`OrderID`) = 3 ORDER BY `o`.`OrderID`, `o1`.`OrderID`"); } @@ -2647,7 +2647,7 @@ WHERE EXISTS ( """ SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` -WHERE `c`.`CustomerID` IN ('ALFKI', 'FISSA') AND `c`.`City` = 'Seattle' +WHERE `c`.`CustomerID` IN ('ALFKI', 'FISSA', 'WHITC') AND `c`.`City` = 'Seattle' """); } diff --git a/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs index e49c206..2818d38 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/NullSemanticsQueryJetTest.cs @@ -1084,7 +1084,7 @@ WHERE `e`.`StringA` IN ('Foo', 'Bar')", // $@"SELECT `e`.`Id` FROM `Entities1` AS `e` -WHERE `e`.`StringA` LIKE 'A%'"); +WHERE `e`.`StringA` LIKE 'B%'"); } public override async Task Where_nested_conditional_search_condition_in_result(bool async) diff --git a/test/EFCore.Jet.FunctionalTests/Query/SqlQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/SqlQueryJetTest.cs index 30c6da8..279f2d9 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/SqlQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/SqlQueryJetTest.cs @@ -221,7 +221,7 @@ FROM ( ) AS `m0` WHERE `m`.`CustomerID` = `m0`.`CustomerID` """, - // +// """ p0='Berlin' (Size = 255) p1='1998-04-01T00:00:00.0000000' (DbType = DateTime) @@ -337,7 +337,7 @@ FROM ( ) AS `m0` WHERE `m`.`CustomerID` = `m0`.`CustomerID` """, - // +// """ p0='Berlin' (Size = 255) p1='1998-04-01T00:00:00.0000000' (DbType = DateTime) @@ -394,7 +394,7 @@ WHERE `m`.`ContactTitle` = @__contactTitle_1 """ SELECT * FROM `Customers` WHERE `City` = 'London' """, - // +// """ SELECT * FROM `Customers` WHERE `City` = 'Seattle' """); @@ -411,7 +411,7 @@ p1='Sales Representative' (Size = 255) SELECT * FROM `Customers` WHERE `City` = @p0 AND `ContactTitle` = @p1 """, - // +// """ p0='Madrid' (Size = 255) p1='Accounting Manager' (Size = 255) @@ -454,23 +454,23 @@ FROM ( """ SELECT * FROM `Customers` WHERE `ContactName` LIKE '%z%' """, - // +// """ SELECT * FROM `Customers` """); } - public override async Task SqlQueryRaw_composed_with_nullable_predicate(bool async) + public override async Task SqlQueryRaw_composed_with_predicate(bool async) { - await base.SqlQueryRaw_composed_with_nullable_predicate(async); + await base.SqlQueryRaw_composed_with_predicate(async); AssertSql( -""" + """ SELECT `m`.`Address`, `m`.`City`, `m`.`CompanyName`, `m`.`ContactName`, `m`.`ContactTitle`, `m`.`Country`, `m`.`CustomerID`, `m`.`Fax`, `m`.`Phone`, `m`.`Region`, `m`.`PostalCode` FROM ( SELECT * FROM `Customers` ) AS `m` -WHERE `m`.`ContactName` = `m`.`CompanyName` +WHERE MID(`m`.`ContactName`, 0 + 1, 1) = MID(`m`.`CompanyName`, 0 + 1, 1) """); } @@ -508,7 +508,7 @@ p0='London' (Size = 255) SELECT * FROM `Customers` WHERE `City` = @p0 AND `ContactTitle` = @title """, - // +// """ @city='London' (Nullable = false) (Size = 6) p1='Sales Representative' (Size = 255) @@ -527,7 +527,7 @@ SELECT * FROM `Customers` WHERE `City` = @city AND `ContactTitle` = @p1 SELECT * FROM `Customers` WHERE `CustomerID` = @id """, - // +// """ @id='ALFKI' (Nullable = false) (Size = 5) @@ -572,7 +572,7 @@ FROM ( SELECT * FROM `Orders` WHERE `OrderID` >= @p0 ) AS `m` """, - // +// """ @__max_1='10400' p0='10300' @@ -588,7 +588,7 @@ WHERE `m`.`OrderID` <= @__max_1 AND `m`.`OrderID` IN ( ) AS `m0` ) """, - // +// """ @__max_1='10400' p0='10300' @@ -734,7 +734,7 @@ WHERE `m`.`CustomerID` IN ( ) AS `m0` ) """, - // +// """ @city='London' (Nullable = false) (Size = 6) p1='Sales Representative' (Size = 255) diff --git a/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs index 494bc08..9fdb2b3 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs @@ -4047,10 +4047,10 @@ FROM (SELECT COUNT(*) FROM `#Dual`) await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ SELECT `t`.`Id`, `t`.`GearNickName`, `t`.`GearSquadId`, `t`.`IssueDate`, `t`.`Note` FROM `Tags` AS `t` -WHERE `t`.`Id` IN ('{d2c26679-562b-44d1-ab96-23d1775e0926}', '{23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3}', '{ab1b82d7-88db-42bd-a132-7eef9aa68af4}') +WHERE `t`.`Id` IN ('{df36f493-463f-4123-83f9-6b135deeb7ba}', '{23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3}', '{ab1b82d7-88db-42bd-a132-7eef9aa68af4}') """); } @@ -9819,30 +9819,36 @@ WHERE 0 = 1 AssertSql( """ -SELECT `l`.`Id`, `l`.`CapitalName`, `l`.`Name`, `l`.`ServerAddress`, `l`.`CommanderName`, `l`.`Eradicated` -FROM `LocustHordes` AS `l` -LEFT JOIN `Cities` AS `c` ON `l`.`CapitalName` = `c`.`Name` +SELECT `t`.`Nickname`, `t`.`SquadId`, `t`.`AssignedCityName`, `t`.`CityOfBirthName`, `t`.`FullName`, `t`.`HasSoulPatch`, `t`.`LeaderNickname`, `t`.`LeaderSquadId`, `t`.`Rank`, `t`.`Discriminator` +FROM ( + SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, 'Gear' AS `Discriminator` + FROM `Gears` AS `g` + UNION ALL + SELECT `o`.`Nickname`, `o`.`SquadId`, `o`.`AssignedCityName`, `o`.`CityOfBirthName`, `o`.`FullName`, `o`.`HasSoulPatch`, `o`.`LeaderNickname`, `o`.`LeaderSquadId`, `o`.`Rank`, 'Officer' AS `Discriminator` + FROM `Officers` AS `o` +) AS `t` +LEFT JOIN `Cities` AS `c` ON `t`.`AssignedCityName` = `c`.`Name` WHERE `c`.`Name` = ( SELECT TOP 1 `c0`.`Name` FROM ( - SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, 'Gear' AS `Discriminator` - FROM `Gears` AS `g` + SELECT `g0`.`Nickname`, `g0`.`SquadId`, `g0`.`AssignedCityName`, `g0`.`CityOfBirthName`, `g0`.`FullName`, `g0`.`HasSoulPatch`, `g0`.`LeaderNickname`, `g0`.`LeaderSquadId`, `g0`.`Rank`, 'Gear' AS `Discriminator` + FROM `Gears` AS `g0` UNION ALL - SELECT `o`.`Nickname`, `o`.`SquadId`, `o`.`AssignedCityName`, `o`.`CityOfBirthName`, `o`.`FullName`, `o`.`HasSoulPatch`, `o`.`LeaderNickname`, `o`.`LeaderSquadId`, `o`.`Rank`, 'Officer' AS `Discriminator` - FROM `Officers` AS `o` - ) AS `t` - INNER JOIN `Cities` AS `c0` ON `t`.`CityOfBirthName` = `c0`.`Name` - ORDER BY `t`.`Nickname`) OR (`c`.`Name` IS NULL AND ( + SELECT `o0`.`Nickname`, `o0`.`SquadId`, `o0`.`AssignedCityName`, `o0`.`CityOfBirthName`, `o0`.`FullName`, `o0`.`HasSoulPatch`, `o0`.`LeaderNickname`, `o0`.`LeaderSquadId`, `o0`.`Rank`, 'Officer' AS `Discriminator` + FROM `Officers` AS `o0` + ) AS `t0` + INNER JOIN `Cities` AS `c0` ON `t0`.`CityOfBirthName` = `c0`.`Name` + ORDER BY `t0`.`Nickname`) OR (`c`.`Name` IS NULL AND ( SELECT TOP 1 `c0`.`Name` FROM ( - SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, 'Gear' AS `Discriminator` - FROM `Gears` AS `g` + SELECT `g0`.`Nickname`, `g0`.`SquadId`, `g0`.`AssignedCityName`, `g0`.`CityOfBirthName`, `g0`.`FullName`, `g0`.`HasSoulPatch`, `g0`.`LeaderNickname`, `g0`.`LeaderSquadId`, `g0`.`Rank`, 'Gear' AS `Discriminator` + FROM `Gears` AS `g0` UNION ALL - SELECT `o`.`Nickname`, `o`.`SquadId`, `o`.`AssignedCityName`, `o`.`CityOfBirthName`, `o`.`FullName`, `o`.`HasSoulPatch`, `o`.`LeaderNickname`, `o`.`LeaderSquadId`, `o`.`Rank`, 'Officer' AS `Discriminator` - FROM `Officers` AS `o` - ) AS `t` - INNER JOIN `Cities` AS `c0` ON `t`.`CityOfBirthName` = `c0`.`Name` - ORDER BY `t`.`Nickname`) IS NULL) + SELECT `o0`.`Nickname`, `o0`.`SquadId`, `o0`.`AssignedCityName`, `o0`.`CityOfBirthName`, `o0`.`FullName`, `o0`.`HasSoulPatch`, `o0`.`LeaderNickname`, `o0`.`LeaderSquadId`, `o0`.`Rank`, 'Officer' AS `Discriminator` + FROM `Officers` AS `o0` + ) AS `t0` + INNER JOIN `Cities` AS `c0` ON `t0`.`CityOfBirthName` = `c0`.`Name` + ORDER BY `t0`.`Nickname`) IS NULL) """); } @@ -10108,9 +10114,9 @@ WHERE IIF(`t`.`HasSoulPatch` = @__prm_0, TRUE, FALSE) = TRUE await base.Conditional_expression_with_test_being_simplified_to_constant_complex(isAsync); AssertSql( -""" + """ @__prm_0='True' -@__prm2_1='Dom's Lancer' (Size = 255) +@__prm2_1='Marcus' Lancer' (Size = 255) SELECT `t`.`Nickname`, `t`.`SquadId`, `t`.`AssignedCityName`, `t`.`CityOfBirthName`, `t`.`FullName`, `t`.`HasSoulPatch`, `t`.`LeaderNickname`, `t`.`LeaderSquadId`, `t`.`Rank`, `t`.`Discriminator` FROM ( @@ -10281,7 +10287,7 @@ FROM ( SELECT `l0`.`Name`, `l0`.`LocustHordeId`, `l0`.`ThreatLevel`, `l0`.`ThreatLevelByte`, `l0`.`ThreatLevelNullableByte`, `l0`.`DefeatedByNickname`, `l0`.`DefeatedBySquadId`, `l0`.`HighCommandId`, 'LocustCommander' AS `Discriminator` FROM `LocustCommanders` AS `l0` ) AS `t` -WHERE CLNG(`t`.`ThreatLevel`) >= (5 + CLNG(`t`.`ThreatLevel`)) +WHERE CLNG(`t`.`ThreatLevel`) <= (5 + CLNG(`t`.`ThreatLevel`)) """); } @@ -10349,7 +10355,7 @@ WHERE DATEPART('h', `m`.`Duration`) = 1 """ SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Date`, `m`.`Duration`, `m`.`Rating`, `m`.`Time`, `m`.`Timeline` FROM `Missions` AS `m` -WHERE DATEPART('n', `m`.`Duration`) = 1 +WHERE DATEPART('n', `m`.`Duration`) = 2 """); } @@ -10361,7 +10367,7 @@ WHERE DATEPART('n', `m`.`Duration`) = 1 """ SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Date`, `m`.`Duration`, `m`.`Rating`, `m`.`Time`, `m`.`Timeline` FROM `Missions` AS `m` -WHERE DATEPART('s', `m`.`Duration`) = 1 +WHERE DATEPART('s', `m`.`Duration`) = 3 """); } @@ -10965,10 +10971,10 @@ ORDER BY [t].[Nickname], [t0].[Id] await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT `s`.`Name` FROM `Squads` AS `s` -WHERE `s`.`Name` = 'Kilo' AND IIF(( +WHERE `s`.`Name` = 'Delta' AND IIF(( SELECT TOP 1 `t`.`SquadId` FROM ( SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, 'Gear' AS `Discriminator` @@ -10977,7 +10983,8 @@ WHERE `s`.`Name` = 'Kilo' AND IIF(( SELECT `o`.`Nickname`, `o`.`SquadId`, `o`.`AssignedCityName`, `o`.`CityOfBirthName`, `o`.`FullName`, `o`.`HasSoulPatch`, `o`.`LeaderNickname`, `o`.`LeaderSquadId`, `o`.`Rank`, 'Officer' AS `Discriminator` FROM `Officers` AS `o` ) AS `t` - WHERE `s`.`Id` = `t`.`SquadId` AND `t`.`HasSoulPatch` = TRUE) IS NULL, 0, ( + WHERE `s`.`Id` = `t`.`SquadId` AND `t`.`HasSoulPatch` = TRUE + ORDER BY `t`.`FullName`) IS NULL, 0, ( SELECT TOP 1 `t`.`SquadId` FROM ( SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, 'Gear' AS `Discriminator` @@ -10986,7 +10993,8 @@ WHERE `s`.`Name` = 'Kilo' AND IIF(( SELECT `o`.`Nickname`, `o`.`SquadId`, `o`.`AssignedCityName`, `o`.`CityOfBirthName`, `o`.`FullName`, `o`.`HasSoulPatch`, `o`.`LeaderNickname`, `o`.`LeaderSquadId`, `o`.`Rank`, 'Officer' AS `Discriminator` FROM `Officers` AS `o` ) AS `t` - WHERE `s`.`Id` = `t`.`SquadId` AND `t`.`HasSoulPatch` = TRUE)) <> 0 + WHERE `s`.`Id` = `t`.`SquadId` AND `t`.`HasSoulPatch` = TRUE + ORDER BY `t`.`FullName`)) <> 0 """); } @@ -11796,10 +11804,9 @@ WHERE `t`.`HasSoulPatch` = TRUE AND `t`.`HasSoulPatch` IN (FALSE, TRUE) await base.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping(async); AssertSql( -""" -@__place_0='Seattle' (Size = 255) -@__place_0_1='Seattle' (Size = 100) -@__place_0_1='Seattle' (Size = 100) + """ +@__place_0='Ephyra's location' (Size = 255), @__place_0_1='Ephyra's location' (Size = 100) +@__place_0_1='Ephyra's location' (Size = 100) SELECT `c`.`Name`, `c`.`Location`, `c`.`Nation` FROM `Cities` AS `c` @@ -12779,6 +12786,27 @@ WHERE NOT EXISTS ( """); } + public override async Task Where_subquery_equality_to_null_with_composite_key_should_match_nulls(bool async) + { + await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); + + AssertSql( + """ +SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] +FROM [Squads] AS [s] +WHERE NOT EXISTS ( + SELECT 1 + FROM ( + SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], N'Gear' AS [Discriminator] + FROM [Gears] AS [g] + UNION ALL + SELECT [o].[Nickname], [o].[SquadId], [o].[AssignedCityName], [o].[CityOfBirthName], [o].[FullName], [o].[HasSoulPatch], [o].[LeaderNickname], [o].[LeaderSquadId], [o].[Rank], N'Officer' AS [Discriminator] + FROM [Officers] AS [o] + ) AS [t] + WHERE [s].[Id] = [t].[SquadId] AND [t].[FullName] = N'Anthony Carmine') +"""); + } + public override async Task Where_subquery_equality_to_null_without_composite_key(bool async) { await base.Where_subquery_equality_to_null_without_composite_key(async); @@ -12800,6 +12828,27 @@ WHERE NOT EXISTS ( """); } + public override async Task Where_subquery_equality_to_null_without_composite_key_should_match_null(bool async) + { + await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); + + AssertSql( + """ +SELECT [t].[Nickname], [t].[SquadId], [t].[AssignedCityName], [t].[CityOfBirthName], [t].[FullName], [t].[HasSoulPatch], [t].[LeaderNickname], [t].[LeaderSquadId], [t].[Rank], [t].[Discriminator] +FROM ( + SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], N'Gear' AS [Discriminator] + FROM [Gears] AS [g] + UNION ALL + SELECT [o].[Nickname], [o].[SquadId], [o].[AssignedCityName], [o].[CityOfBirthName], [o].[FullName], [o].[HasSoulPatch], [o].[LeaderNickname], [o].[LeaderSquadId], [o].[Rank], N'Officer' AS [Discriminator] + FROM [Officers] AS [o] +) AS [t] +WHERE NOT EXISTS ( + SELECT 1 + FROM [Weapons] AS [w] + WHERE [t].[FullName] = [w].[OwnerFullName] AND [w].[Name] = N'Hammer of Dawn') +"""); + } + public override async Task Include_reference_on_derived_type_using_EF_Property(bool async) { await base.Include_reference_on_derived_type_using_EF_Property(async); diff --git a/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs index f456548..bdd33fc 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs @@ -3264,10 +3264,10 @@ FROM (SELECT COUNT(*) FROM `#Dual`) await base.Contains_with_local_nullable_guid_list_closure(async); AssertSql( -""" + """ SELECT `t`.`Id`, `t`.`GearNickName`, `t`.`GearSquadId`, `t`.`IssueDate`, `t`.`Note` FROM `Tags` AS `t` -WHERE `t`.`Id` IN ('{d2c26679-562b-44d1-ab96-23d1775e0926}', '{23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3}', '{ab1b82d7-88db-42bd-a132-7eef9aa68af4}') +WHERE `t`.`Id` IN ('{df36f493-463f-4123-83f9-6b135deeb7ba}', '{23cbcf9b-ce14-45cf-aafa-2c2667ebfdd3}', '{ab1b82d7-88db-42bd-a132-7eef9aa68af4}') """); } @@ -7946,22 +7946,22 @@ WHERE 0 = 1 await base.FirstOrDefault_navigation_access_entity_equality_in_where_predicate_apply_peneding_selector(async); AssertSql( -""" -SELECT `f`.`Id`, `f`.`CapitalName`, `f`.`Name`, `f`.`ServerAddress`, `l`.`CommanderName`, `l`.`Eradicated`, IIF(`l`.`Id` IS NOT NULL, 'LocustHorde', NULL) AS `Discriminator` -FROM (`Factions` AS `f` -LEFT JOIN `LocustHordes` AS `l` ON `f`.`Id` = `l`.`Id`) -LEFT JOIN `Cities` AS `c` ON `f`.`CapitalName` = `c`.`Name` + """ +SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, IIF(`o`.`Nickname` IS NOT NULL, 'Officer', NULL) AS `Discriminator` +FROM (`Gears` AS `g` +LEFT JOIN `Officers` AS `o` ON `g`.`Nickname` = `o`.`Nickname` AND `g`.`SquadId` = `o`.`SquadId`) +LEFT JOIN `Cities` AS `c` ON `g`.`AssignedCityName` = `c`.`Name` WHERE `c`.`Name` = ( SELECT TOP 1 `c0`.`Name` - FROM (`Gears` AS `g` - LEFT JOIN `Officers` AS `o` ON `g`.`Nickname` = `o`.`Nickname` AND `g`.`SquadId` = `o`.`SquadId`) - INNER JOIN `Cities` AS `c0` ON `g`.`CityOfBirthName` = `c0`.`Name` - ORDER BY `g`.`Nickname`) OR (`c`.`Name` IS NULL AND ( + FROM (`Gears` AS `g0` + LEFT JOIN `Officers` AS `o0` ON `g0`.`Nickname` = `o0`.`Nickname` AND `g0`.`SquadId` = `o0`.`SquadId`) + INNER JOIN `Cities` AS `c0` ON `g0`.`CityOfBirthName` = `c0`.`Name` + ORDER BY `g0`.`Nickname`) OR (`c`.`Name` IS NULL AND ( SELECT TOP 1 `c0`.`Name` - FROM (`Gears` AS `g` - LEFT JOIN `Officers` AS `o` ON `g`.`Nickname` = `o`.`Nickname` AND `g`.`SquadId` = `o`.`SquadId`) - INNER JOIN `Cities` AS `c0` ON `g`.`CityOfBirthName` = `c0`.`Name` - ORDER BY `g`.`Nickname`) IS NULL) + FROM (`Gears` AS `g0` + LEFT JOIN `Officers` AS `o0` ON `g0`.`Nickname` = `o0`.`Nickname` AND `g0`.`SquadId` = `o0`.`SquadId`) + INNER JOIN `Cities` AS `c0` ON `g0`.`CityOfBirthName` = `c0`.`Name` + ORDER BY `g0`.`Nickname`) IS NULL) """); } @@ -8196,9 +8196,9 @@ WHERE IIF(`g`.`HasSoulPatch` = @__prm_0, TRUE, FALSE) = TRUE await base.Conditional_expression_with_test_being_simplified_to_constant_complex(isAsync); AssertSql( -""" + """ @__prm_0='True' -@__prm2_1='Dom's Lancer' (Size = 255) +@__prm2_1='Marcus' Lancer' (Size = 255) SELECT `g`.`Nickname`, `g`.`SquadId`, `g`.`AssignedCityName`, `g`.`CityOfBirthName`, `g`.`FullName`, `g`.`HasSoulPatch`, `g`.`LeaderNickname`, `g`.`LeaderSquadId`, `g`.`Rank`, IIF(`o`.`Nickname` IS NOT NULL, 'Officer', NULL) AS `Discriminator` FROM `Gears` AS `g` @@ -8336,7 +8336,7 @@ WHERE CBYTE(`l`.`ThreatLevel`) >= CBYTE(5) SELECT `l`.`Name`, `l`.`LocustHordeId`, `l`.`ThreatLevel`, `l`.`ThreatLevelByte`, `l`.`ThreatLevelNullableByte`, `l0`.`DefeatedByNickname`, `l0`.`DefeatedBySquadId`, `l0`.`HighCommandId`, IIF(`l0`.`Name` IS NOT NULL, 'LocustCommander', NULL) AS `Discriminator` FROM `LocustLeaders` AS `l` LEFT JOIN `LocustCommanders` AS `l0` ON `l`.`Name` = `l0`.`Name` -WHERE CLNG(`l`.`ThreatLevel`) >= (5 + CLNG(`l`.`ThreatLevel`)) +WHERE CLNG(`l`.`ThreatLevel`) <= (5 + CLNG(`l`.`ThreatLevel`)) """); } @@ -8404,7 +8404,7 @@ WHERE DATEPART('h', `m`.`Duration`) = 1 """ SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Date`, `m`.`Duration`, `m`.`Rating`, `m`.`Time`, `m`.`Timeline` FROM `Missions` AS `m` -WHERE DATEPART('n', `m`.`Duration`) = 1 +WHERE DATEPART('n', `m`.`Duration`) = 2 """); } @@ -8416,7 +8416,7 @@ WHERE DATEPART('n', `m`.`Duration`) = 1 """ SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Date`, `m`.`Duration`, `m`.`Rating`, `m`.`Time`, `m`.`Timeline` FROM `Missions` AS `m` -WHERE DATEPART('s', `m`.`Duration`) = 1 +WHERE DATEPART('s', `m`.`Duration`) = 3 """); } @@ -8863,18 +8863,20 @@ ORDER BY [g].[Nickname], [t].[Id] await base.FirstOrDefault_over_int_compared_to_zero(async); AssertSql( -""" + """ SELECT `s`.`Name` FROM `Squads` AS `s` -WHERE `s`.`Name` = 'Kilo' AND IIF(( +WHERE `s`.`Name` = 'Delta' AND IIF(( SELECT TOP 1 `g`.`SquadId` FROM `Gears` AS `g` LEFT JOIN `Officers` AS `o` ON `g`.`Nickname` = `o`.`Nickname` AND `g`.`SquadId` = `o`.`SquadId` - WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE) IS NULL, 0, ( + WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE + ORDER BY `g`.`FullName`) IS NULL, 0, ( SELECT TOP 1 `g`.`SquadId` FROM `Gears` AS `g` LEFT JOIN `Officers` AS `o` ON `g`.`Nickname` = `o`.`Nickname` AND `g`.`SquadId` = `o`.`SquadId` - WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE)) <> 0 + WHERE `s`.`Id` = `g`.`SquadId` AND `g`.`HasSoulPatch` = TRUE + ORDER BY `g`.`FullName`)) <> 0 """); } @@ -9550,9 +9552,8 @@ WHERE `g`.`HasSoulPatch` = TRUE AND `g`.`HasSoulPatch` IN (FALSE, TRUE) AssertSql( """ -@__place_0='Seattle' (Size = 255) -@__place_0_1='Seattle' (Size = 100) -@__place_0_1='Seattle' (Size = 100) +@__place_0='Ephyra's location' (Size = 255), @__place_0_1='Ephyra's location' (Size = 100) +@__place_0_1='Ephyra's location' (Size = 100) SELECT `c`.`Name`, `c`.`Location`, `c`.`Nation` FROM `Cities` AS `c` @@ -10396,6 +10397,22 @@ WHERE NOT EXISTS ( """); } + public override async Task Where_subquery_equality_to_null_with_composite_key_should_match_nulls(bool async) + { + await base.Where_subquery_equality_to_null_with_composite_key_should_match_nulls(async); + + AssertSql( + """ +SELECT [s].[Id], [s].[Banner], [s].[Banner5], [s].[InternalNumber], [s].[Name] +FROM [Squads] AS [s] +WHERE NOT EXISTS ( + SELECT 1 + FROM [Gears] AS [g] + LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] + WHERE [s].[Id] = [g].[SquadId] AND [g].[FullName] = N'Anthony Carmine') +"""); + } + public override async Task Where_subquery_equality_to_null_without_composite_key(bool async) { await base.Where_subquery_equality_to_null_without_composite_key(async); @@ -10412,6 +10429,24 @@ WHERE NOT EXISTS ( """); } + public override async Task Where_subquery_equality_to_null_without_composite_key_should_match_null(bool async) + { + await base.Where_subquery_equality_to_null_without_composite_key_should_match_null(async); + + AssertSql( + """ +SELECT [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], CASE + WHEN [o].[Nickname] IS NOT NULL THEN N'Officer' +END AS [Discriminator] +FROM [Gears] AS [g] +LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] +WHERE NOT EXISTS ( + SELECT 1 + FROM [Weapons] AS [w] + WHERE [g].[FullName] = [w].[OwnerFullName] AND [w].[Name] = N'Hammer of Dawn') +"""); + } + public override async Task Include_reference_on_derived_type_using_EF_Property(bool async) { await base.Include_reference_on_derived_type_using_EF_Property(async);