diff --git a/Dependencies.targets b/Dependencies.targets index 6b46c8a..f491ffb 100644 --- a/Dependencies.targets +++ b/Dependencies.targets @@ -1,6 +1,6 @@ - [8.0.0, 9.0.0) + [8.0.1, 9.0.0) @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -47,6 +47,6 @@ - + \ No newline at end of file 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 2aae99c..5d95176 100644 --- a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_odbc_x86.txt +++ b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_odbc_x86.txt @@ -12925,6 +12925,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.I EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Inline_collection_of_nullable_ints_Contains(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Inline_collection_of_nullable_ints_Contains(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Json_representation_of_bool_array +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_arrays_and_no_inferred_type_mapping(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_arrays_and_no_inferred_type_mapping(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_Lists_and_no_inferred_type_mapping(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_Lists_and_no_inferred_type_mapping(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Non_nullable_reference_column_collection_index_equals_nullable_column(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Non_nullable_reference_column_collection_index_equals_nullable_column(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nullable_reference_column_collection_index_equals_nullable_column(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 4381379..0dd68c2 100644 --- a/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt +++ b/test/EFCore.Jet.FunctionalTests/GreenTests/ace_2010_oledb_x86.txt @@ -10500,6 +10500,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Multiple_or EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys_inside_subquery(isAsync: True) EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys(isAsync: False) EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys(isAsync: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_expansion_inside_Contains_argument(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_expansion_inside_Contains_argument(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_expansion_with_member_pushdown_inside_Contains_argument(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_expansion_with_member_pushdown_inside_Contains_argument(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_rewrite_Distinct_with_convert EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_rewrite_Distinct_with_convert_anonymous EntityFrameworkCore.Jet.FunctionalTests.Query.GearsOfWarQueryJetTest.Nav_rewrite_with_convert1(isAsync: False) @@ -16287,6 +16291,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.I EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Inline_collection_of_nullable_ints_Contains(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Inline_collection_of_nullable_ints_Contains(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Json_representation_of_bool_array +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_arrays_and_no_inferred_type_mapping(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_arrays_and_no_inferred_type_mapping(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_Lists_and_no_inferred_type_mapping(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nested_contains_with_Lists_and_no_inferred_type_mapping(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Non_nullable_reference_column_collection_index_equals_nullable_column(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Non_nullable_reference_column_collection_index_equals_nullable_column(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.PrimitiveCollectionsQueryJetTest.Nullable_reference_column_collection_index_equals_nullable_column(async: False) @@ -16394,6 +16402,7 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Max_in_multi_level_n EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.MultiContext_query_filter_test EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Multilevel_owned_entities_determine_correct_nullability EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Multiple_optional_navs_should_not_deadlock_Issue_5481 +EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Nested_contains_with_enum EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Nested_include_queries_do_not_populate_navigation_twice EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Nested_owned_required_dependents_are_materialized EntityFrameworkCore.Jet.FunctionalTests.Query.QueryBugsTest.Nested_queries_does_not_cause_concurrency_exception_sync(tracking: False) @@ -17268,6 +17277,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Multiple EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys_inside_subquery(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_expansion_inside_Contains_argument(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_expansion_inside_Contains_argument(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_expansion_with_member_pushdown_inside_Contains_argument(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_expansion_with_member_pushdown_inside_Contains_argument(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_rewrite_Distinct_with_convert EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_rewrite_Distinct_with_convert_anonymous EntityFrameworkCore.Jet.FunctionalTests.Query.TPCGearsOfWarQueryJetTest.Nav_rewrite_with_convert1(async: False) @@ -19027,6 +19040,10 @@ EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Multiple EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys_inside_subquery(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys(async: False) EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Multiple_orderby_with_navigation_expansion_on_one_of_the_order_bys(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_expansion_inside_Contains_argument(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_expansion_inside_Contains_argument(async: True) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_expansion_with_member_pushdown_inside_Contains_argument(async: False) +EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_expansion_with_member_pushdown_inside_Contains_argument(async: True) EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_rewrite_Distinct_with_convert EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_rewrite_Distinct_with_convert_anonymous EntityFrameworkCore.Jet.FunctionalTests.Query.TPTGearsOfWarQueryJetTest.Nav_rewrite_with_convert1(async: False) diff --git a/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs index 7b4edb8..c947a53 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs @@ -9644,6 +9644,91 @@ GROUP BY `s`.`Name` """); } + public override async Task Nav_expansion_inside_Contains_argument(bool async) + { + await base.Nav_expansion_inside_Contains_argument(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 IIF(EXISTS ( + SELECT 1 + FROM `Weapons` AS `w` + WHERE `g`.`FullName` = `w`.`OwnerFullName`), 1, 0) IN (1, -1) +"""); + } + + public override async Task Nav_expansion_with_member_pushdown_inside_Contains_argument(bool async) + { + await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(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 ( + SELECT TOP 1 `w`.`Name` + FROM `Weapons` AS `w` + WHERE `g`.`FullName` = `w`.`OwnerFullName` + ORDER BY `w`.`Id`) IN ('Marcus'' Lancer', 'Dom''s Gnasher') +"""); + } + + public override async Task Subquery_inside_Take_argument(bool async) + { + await base.Subquery_inside_Take_argument(async); + + AssertSql( + """ +@__numbers_0='[0,1,2]' (Size = 4000) + +SELECT [g].[Nickname], [g].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[SynergyWithId] +FROM [Gears] AS [g] +LEFT JOIN ( + SELECT [t].[Id], [t].[AmmunitionType], [t].[IsAutomatic], [t].[Name], [t].[OwnerFullName], [t].[SynergyWithId] + FROM ( + SELECT [w].[Id], [w].[AmmunitionType], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName], [w].[SynergyWithId], ROW_NUMBER() OVER(PARTITION BY [w].[OwnerFullName] ORDER BY [w].[Id]) AS [row] + FROM [Weapons] AS [w] + ) AS [t] + WHERE [t].[row] <= COALESCE(( + SELECT [n].[value] + FROM OPENJSON(@__numbers_0) WITH ([value] int '$') AS [n] + ORDER BY [n].[value] + OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY), 0) +) AS [t0] ON [g].[FullName] = [t0].[OwnerFullName] +ORDER BY [g].[Nickname], [g].[SquadId], [t0].[OwnerFullName], [t0].[Id] +"""); + } + + public override async Task Nav_expansion_inside_Skip_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_Skip_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_inside_Take_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_Take_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_with_member_pushdown_inside_Take_correlated_to_source(bool async) + { + await base.Nav_expansion_with_member_pushdown_inside_Take_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_inside_ElementAt_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_ElementAt_correlated_to_source(async); + + AssertSql(); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); } diff --git a/test/EFCore.Jet.FunctionalTests/Query/PrimitiveCollectionsQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/PrimitiveCollectionsQueryJetTest.cs index b2e30fe..33587db 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/PrimitiveCollectionsQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/PrimitiveCollectionsQueryJetTest.cs @@ -617,6 +617,30 @@ ORDER BY `p`.`Id` """); } + public override async Task Nested_contains_with_Lists_and_no_inferred_type_mapping(bool async) + { + await base.Nested_contains_with_Lists_and_no_inferred_type_mapping(async); + + AssertSql( +""" +SELECT `p`.`Id`, `p`.`Bool`, `p`.`Bools`, `p`.`DateTime`, `p`.`DateTimes`, `p`.`Enum`, `p`.`Enums`, `p`.`Int`, `p`.`Ints`, `p`.`NullableInt`, `p`.`NullableInts`, `p`.`NullableString`, `p`.`NullableStrings`, `p`.`String`, `p`.`Strings` +FROM `PrimitiveCollectionsEntity` AS `p` +WHERE IIF(`p`.`Int` IN (1, 2, 3), 'one', 'two') IN ('one', 'two', 'three') +"""); + } + + public override async Task Nested_contains_with_arrays_and_no_inferred_type_mapping(bool async) + { + await base.Nested_contains_with_arrays_and_no_inferred_type_mapping(async); + + AssertSql( +""" +SELECT `p`.`Id`, `p`.`Bool`, `p`.`Bools`, `p`.`DateTime`, `p`.`DateTimes`, `p`.`Enum`, `p`.`Enums`, `p`.`Int`, `p`.`Ints`, `p`.`NullableInt`, `p`.`NullableInts`, `p`.`NullableString`, `p`.`NullableStrings`, `p`.`String`, `p`.`Strings` +FROM `PrimitiveCollectionsEntity` AS `p` +WHERE IIF(`p`.`Int` IN (1, 2, 3), 'one', 'two') IN ('one', 'two', 'three') +"""); + } + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.Jet.FunctionalTests/Query/QueryBugsTest.cs b/test/EFCore.Jet.FunctionalTests/Query/QueryBugsTest.cs index 6a41c3e..61594d0 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/QueryBugsTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/QueryBugsTest.cs @@ -3869,17 +3869,11 @@ WHERE `r`.`MyTime` = #2018-10-07# AssertSql( """ @__key_2='5f221fb9-66f4-442a-92c9-d97ed5989cc7' -@__keys_0='["0a47bcb7-a1cb-4345-8944-c58f82d6aac7","5f221fb9-66f4-442a-92c9-d97ed5989cc7"]' (Size = 4000) - -SELECT [t].[Id], [t].[Type] -FROM [Todos] AS [t] -WHERE CASE - WHEN [t].[Type] = 0 THEN @__key_2 - ELSE @__key_2 -END IN ( - SELECT [k].[value] - FROM OPENJSON(@__keys_0) WITH ([value] uniqueidentifier '$') AS [k] -) +@__key_2='5f221fb9-66f4-442a-92c9-d97ed5989cc7' + +SELECT `t`.`Id`, `t`.`Type` +FROM `Todos` AS `t` +WHERE IIF(`t`.`Type` = 0, @__key_2, @__key_2) IN ('{0a47bcb7-a1cb-4345-8944-c58f82d6aac7}', '{5f221fb9-66f4-442a-92c9-d97ed5989cc7}') """); } } diff --git a/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs index 391a070..61f68a8 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/TPCGearsOfWarQueryJetTest.cs @@ -13178,6 +13178,109 @@ GROUP BY `s`.`Name` """); } + public override async Task Nav_expansion_inside_Contains_argument(bool async) + { + await base.Nav_expansion_inside_Contains_argument(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`, '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` +WHERE IIF(EXISTS ( + SELECT 1 + FROM `Weapons` AS `w` + WHERE `t`.`FullName` = `w`.`OwnerFullName`), 1, 0) IN (1, -1) +"""); + } + + public override async Task Nav_expansion_with_member_pushdown_inside_Contains_argument(bool async) + { + await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(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`, '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` +WHERE ( + SELECT TOP 1 `w`.`Name` + FROM `Weapons` AS `w` + WHERE `t`.`FullName` = `w`.`OwnerFullName` + ORDER BY `w`.`Id`) IN ('Marcus'' Lancer', 'Dom''s Gnasher') +"""); + } + + public override async Task Subquery_inside_Take_argument(bool async) + { + await base.Subquery_inside_Take_argument(async); + + AssertSql( + """ +@__numbers_0='[0,1,2]' (Size = 4000) + +SELECT [t].[Nickname], [t].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[SynergyWithId] +FROM ( + SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] + FROM [Gears] AS [g] + UNION ALL + SELECT [o].[Nickname], [o].[SquadId], [o].[FullName] + FROM [Officers] AS [o] +) AS [t] +LEFT JOIN ( + SELECT [t1].[Id], [t1].[AmmunitionType], [t1].[IsAutomatic], [t1].[Name], [t1].[OwnerFullName], [t1].[SynergyWithId] + FROM ( + SELECT [w].[Id], [w].[AmmunitionType], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName], [w].[SynergyWithId], ROW_NUMBER() OVER(PARTITION BY [w].[OwnerFullName] ORDER BY [w].[Id]) AS [row] + FROM [Weapons] AS [w] + ) AS [t1] + WHERE [t1].[row] <= COALESCE(( + SELECT [n].[value] + FROM OPENJSON(@__numbers_0) WITH ([value] int '$') AS [n] + ORDER BY [n].[value] + OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY), 0) +) AS [t0] ON [t].[FullName] = [t0].[OwnerFullName] +ORDER BY [t].[Nickname], [t].[SquadId], [t0].[OwnerFullName], [t0].[Id] +"""); + } + + public override async Task Nav_expansion_inside_Skip_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_Skip_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_inside_Take_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_Take_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_with_member_pushdown_inside_Take_correlated_to_source(bool async) + { + await base.Nav_expansion_with_member_pushdown_inside_Take_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_inside_ElementAt_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_ElementAt_correlated_to_source(async); + + AssertSql(); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); } diff --git a/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs index 59ec4ab..c035711 100644 --- a/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/Query/TPTGearsOfWarQueryJetTest.cs @@ -10710,6 +10710,93 @@ GROUP BY `s`.`Name` """); } + public override async Task Nav_expansion_inside_Contains_argument(bool async) + { + await base.Nav_expansion_inside_Contains_argument(async); + + AssertSql( +""" +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` +WHERE IIF(EXISTS ( + SELECT 1 + FROM `Weapons` AS `w` + WHERE `g`.`FullName` = `w`.`OwnerFullName`), 1, 0) IN (1, -1) +"""); + } + + public override async Task Nav_expansion_with_member_pushdown_inside_Contains_argument(bool async) + { + await base.Nav_expansion_with_member_pushdown_inside_Contains_argument(async); + + AssertSql( + """ +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` +WHERE ( + SELECT TOP 1 `w`.`Name` + FROM `Weapons` AS `w` + WHERE `g`.`FullName` = `w`.`OwnerFullName` + ORDER BY `w`.`Id`) IN ('Marcus'' Lancer', 'Dom''s Gnasher') +"""); + } + + public override async Task Subquery_inside_Take_argument(bool async) + { + await base.Subquery_inside_Take_argument(async); + + AssertSql( + """ +@__numbers_0='[0,1,2]' (Size = 4000) + +SELECT [g].[Nickname], [g].[SquadId], [t0].[Id], [t0].[AmmunitionType], [t0].[IsAutomatic], [t0].[Name], [t0].[OwnerFullName], [t0].[SynergyWithId] +FROM [Gears] AS [g] +LEFT JOIN ( + SELECT [t].[Id], [t].[AmmunitionType], [t].[IsAutomatic], [t].[Name], [t].[OwnerFullName], [t].[SynergyWithId] + FROM ( + SELECT [w].[Id], [w].[AmmunitionType], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName], [w].[SynergyWithId], ROW_NUMBER() OVER(PARTITION BY [w].[OwnerFullName] ORDER BY [w].[Id]) AS [row] + FROM [Weapons] AS [w] + ) AS [t] + WHERE [t].[row] <= COALESCE(( + SELECT [n].[value] + FROM OPENJSON(@__numbers_0) WITH ([value] int '$') AS [n] + ORDER BY [n].[value] + OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY), 0) +) AS [t0] ON [g].[FullName] = [t0].[OwnerFullName] +ORDER BY [g].[Nickname], [g].[SquadId], [t0].[OwnerFullName], [t0].[Id] +"""); + } + + public override async Task Nav_expansion_inside_Skip_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_Skip_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_inside_Take_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_Take_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_with_member_pushdown_inside_Take_correlated_to_source(bool async) + { + await base.Nav_expansion_with_member_pushdown_inside_Take_correlated_to_source(async); + + AssertSql(); + } + + public override async Task Nav_expansion_inside_ElementAt_correlated_to_source(bool async) + { + await base.Nav_expansion_inside_ElementAt_correlated_to_source(async); + + AssertSql(); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); }