diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs index b2b19b968d2..570051b9f4b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs @@ -20,8 +20,6 @@ public ComplexNavigationsQuerySqlServerTest( //Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); } - private bool SupportsOffset => TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsOffset)) ?? true; - public override async Task Entity_equality_empty(bool async) { await base.Entity_equality_empty(async); @@ -1262,10 +1260,8 @@ public override async Task Complex_multi_include_with_order_by_and_paging(bool a { await base.Complex_multi_include_with_order_by_and_paging(async); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='0' + AssertSql( + @"@__p_0='0' @__p_1='10' SELECT [t].[Id], [t].[Date], [t].[Name], [t].[OneToMany_Optional_Self_Inverse1Id], [t].[OneToMany_Required_Self_Inverse1Id], [t].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l2].[Id], [l2].[Level2_Optional_Id], [l2].[Level2_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse3Id], [l2].[OneToMany_Optional_Self_Inverse3Id], [l2].[OneToMany_Required_Inverse3Id], [l2].[OneToMany_Required_Self_Inverse3Id], [l2].[OneToOne_Optional_PK_Inverse3Id], [l2].[OneToOne_Optional_Self3Id] @@ -1279,17 +1275,14 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[OneToMany_Optional_Inverse3Id] LEFT JOIN [LevelThree] AS [l2] ON [l0].[Id] = [l2].[OneToMany_Required_Inverse3Id] ORDER BY [t].[Name], [t].[Id], [l1].[Id], [l2].[Id]"); - } } public override async Task Complex_multi_include_with_order_by_and_paging_joins_on_correct_key(bool async) { await base.Complex_multi_include_with_order_by_and_paging_joins_on_correct_key(async); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='0' + AssertSql( + @"@__p_0='0' @__p_1='10' SELECT [t].[Id], [t].[Date], [t].[Name], [t].[OneToMany_Optional_Self_Inverse1Id], [t].[OneToMany_Required_Self_Inverse1Id], [t].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id], [l1].[Id], [l1].[Date], [l1].[Level1_Optional_Id], [l1].[Level1_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse2Id], [l1].[OneToMany_Optional_Self_Inverse2Id], [l1].[OneToMany_Required_Inverse2Id], [l1].[OneToMany_Required_Self_Inverse2Id], [l1].[OneToOne_Optional_PK_Inverse2Id], [l1].[OneToOne_Optional_Self2Id], [l2].[Id], [l2].[Level2_Optional_Id], [l2].[Level2_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse3Id], [l2].[OneToMany_Optional_Self_Inverse3Id], [l2].[OneToMany_Required_Inverse3Id], [l2].[OneToMany_Required_Self_Inverse3Id], [l2].[OneToOne_Optional_PK_Inverse3Id], [l2].[OneToOne_Optional_Self3Id], [l3].[Id], [l3].[Level2_Optional_Id], [l3].[Level2_Required_Id], [l3].[Name], [l3].[OneToMany_Optional_Inverse3Id], [l3].[OneToMany_Optional_Self_Inverse3Id], [l3].[OneToMany_Required_Inverse3Id], [l3].[OneToMany_Required_Self_Inverse3Id], [l3].[OneToOne_Optional_PK_Inverse3Id], [l3].[OneToOne_Optional_Self3Id] @@ -1304,17 +1297,14 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY LEFT JOIN [LevelThree] AS [l2] ON [l0].[Id] = [l2].[OneToMany_Optional_Inverse3Id] LEFT JOIN [LevelThree] AS [l3] ON [l1].[Id] = [l3].[OneToMany_Required_Inverse3Id] ORDER BY [t].[Name], [t].[Id], [l2].[Id], [l3].[Id]"); - } } public override async Task Complex_multi_include_with_order_by_and_paging_joins_on_correct_key2(bool async) { await base.Complex_multi_include_with_order_by_and_paging_joins_on_correct_key2(async); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='0' + AssertSql( + @"@__p_0='0' @__p_1='10' SELECT [t].[Id], [t].[Date], [t].[Name], [t].[OneToMany_Optional_Self_Inverse1Id], [t].[OneToMany_Required_Self_Inverse1Id], [t].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id] @@ -1328,7 +1318,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Required_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Optional_Inverse4Id] ORDER BY [t].[Name], [t].[Id], [l2].[Id]"); - } } public override async Task Multiple_include_with_multiple_optional_navigations(bool async) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs index 638f79e2770..e672018b7c0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs @@ -9,8 +9,6 @@ namespace Microsoft.EntityFrameworkCore.Query { public class NorthwindIncludeQuerySqlServerTest : NorthwindIncludeQueryTestBase> { - private bool SupportsOffset => TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsOffset)) ?? true; - // ReSharper disable once UnusedParameter.Local public NorthwindIncludeQuerySqlServerTest(NorthwindQuerySqlServerFixture fixture, ITestOutputHelper testOutputHelper) : base(fixture) @@ -87,10 +85,8 @@ public override void Include_collection_skip_no_order_by(bool useString) { base.Include_collection_skip_no_order_by(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='10' + AssertSql( + @"@__p_0='10' SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM ( @@ -101,17 +97,14 @@ OFFSET @__p_0 ROWS ) AS [t] LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID] ORDER BY [t].[CustomerID], [o].[OrderID]"); - } } public override void Include_collection_take_no_order_by(bool useString) { base.Include_collection_take_no_order_by(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='10' + AssertSql( + @"@__p_0='10' SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM ( @@ -120,17 +113,14 @@ FROM [Customers] AS [c] ) AS [t] LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID] ORDER BY [t].[CustomerID], [o].[OrderID]"); - } } public override void Include_collection_skip_take_no_order_by(bool useString) { base.Include_collection_skip_take_no_order_by(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='10' + AssertSql( + @"@__p_0='10' @__p_1='5' SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] @@ -142,7 +132,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ) AS [t] LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID] ORDER BY [t].[CustomerID], [o].[OrderID]"); - } } public override void Include_reference_and_collection(bool useString) @@ -318,10 +307,8 @@ public override void Include_collection_order_by_non_key_with_skip(bool useStrin { base.Include_collection_order_by_non_key_with_skip(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='10' + AssertSql( + @"@__p_0='10' SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM ( @@ -332,7 +319,6 @@ OFFSET @__p_0 ROWS ) AS [t] LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID] ORDER BY [t].[ContactTitle], [t].[CustomerID], [o].[OrderID]"); - } } public override void Include_collection_order_by_non_key_with_first_or_default(bool useString) @@ -541,10 +527,8 @@ public override void Include_duplicate_collection(bool useString) { base.Include_duplicate_collection(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='2' + AssertSql( + @"@__p_0='2' SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [t0].[CustomerID], [t0].[Address], [t0].[City], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Country], [t0].[Fax], [t0].[Phone], [t0].[PostalCode], [t0].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate] FROM ( @@ -561,17 +545,14 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [t0].[CustomerID] = [o0].[CustomerID] ORDER BY [t].[CustomerID], [t0].[CustomerID], [o].[OrderID], [o0].[OrderID]"); - } } public override void Include_duplicate_collection_result_operator(bool useString) { base.Include_duplicate_collection_result_operator(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_1='1' + AssertSql( + @"@__p_1='1' @__p_0='2' SELECT [t1].[CustomerID], [t1].[Address], [t1].[City], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Country], [t1].[Fax], [t1].[Phone], [t1].[PostalCode], [t1].[Region], [t1].[CustomerID0], [t1].[Address0], [t1].[City0], [t1].[CompanyName0], [t1].[ContactName0], [t1].[ContactTitle0], [t1].[Country0], [t1].[Fax0], [t1].[Phone0], [t1].[PostalCode0], [t1].[Region0], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate] @@ -593,7 +574,6 @@ ORDER BY [t].[CustomerID] LEFT JOIN [Orders] AS [o] ON [t1].[CustomerID] = [o].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [t1].[CustomerID0] = [o0].[CustomerID] ORDER BY [t1].[CustomerID], [t1].[CustomerID0], [o].[OrderID], [o0].[OrderID]"); - } } public override void Include_collection_on_join_clause_with_order_by_and_filter(bool useString) @@ -630,10 +610,8 @@ public override void Include_where_skip_take_projection(bool useString) { base.Include_where_skip_take_projection(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='1' + AssertSql( + @"@__p_0='1' @__p_1='2' SELECT [o0].[CustomerID] @@ -646,17 +624,14 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ) AS [t] INNER JOIN [Orders] AS [o0] ON [t].[OrderID] = [o0].[OrderID] ORDER BY [t].[OrderID], [t].[ProductID]"); - } } public override void Include_duplicate_collection_result_operator2(bool useString) { base.Include_duplicate_collection_result_operator2(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_1='1' + AssertSql( + @"@__p_1='1' @__p_0='2' SELECT [t1].[CustomerID], [t1].[Address], [t1].[City], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Country], [t1].[Fax], [t1].[Phone], [t1].[PostalCode], [t1].[Region], [t1].[CustomerID0], [t1].[Address0], [t1].[City0], [t1].[CompanyName0], [t1].[ContactName0], [t1].[ContactTitle0], [t1].[Country0], [t1].[Fax0], [t1].[Phone0], [t1].[PostalCode0], [t1].[Region0], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] @@ -677,7 +652,6 @@ ORDER BY [t].[CustomerID] ) AS [t1] LEFT JOIN [Orders] AS [o] ON [t1].[CustomerID] = [o].[CustomerID] ORDER BY [t1].[CustomerID], [t1].[CustomerID0], [o].[OrderID]"); - } } public override void Include_multiple_references(bool useString) @@ -705,10 +679,8 @@ public override void Include_duplicate_reference(bool useString) { base.Include_duplicate_reference(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='2' + AssertSql( + @"@__p_0='2' SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate], [c0].[CustomerID], [c0].[Address], [c0].[City], [c0].[CompanyName], [c0].[ContactName], [c0].[ContactTitle], [c0].[Country], [c0].[Fax], [c0].[Phone], [c0].[PostalCode], [c0].[Region] FROM ( @@ -725,17 +697,14 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY LEFT JOIN [Customers] AS [c] ON [t].[CustomerID] = [c].[CustomerID] LEFT JOIN [Customers] AS [c0] ON [t0].[CustomerID] = [c0].[CustomerID] ORDER BY [t].[CustomerID], [t].[OrderID]"); - } } public override void Include_duplicate_reference2(bool useString) { base.Include_duplicate_reference2(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='2' + AssertSql( + @"@__p_0='2' SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate] FROM ( @@ -751,17 +720,14 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY ) AS [t0] LEFT JOIN [Customers] AS [c] ON [t].[CustomerID] = [c].[CustomerID] ORDER BY [t].[OrderID]"); - } } public override void Include_duplicate_reference3(bool useString) { base.Include_duplicate_reference3(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='2' + AssertSql( + @"@__p_0='2' SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM ( @@ -777,7 +743,6 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY ) AS [t0] LEFT JOIN [Customers] AS [c] ON [t0].[CustomerID] = [c].[CustomerID] ORDER BY [t].[OrderID]"); - } } public override void Include_reference_when_projection(bool useString) @@ -938,10 +903,8 @@ public override void Include_with_skip(bool useString) { base.Include_with_skip(useString); - if (SupportsOffset) - { - AssertSql( - @"@__p_0='80' + AssertSql( + @"@__p_0='80' SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM ( @@ -952,7 +915,6 @@ OFFSET @__p_0 ROWS ) AS [t] LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID] ORDER BY [t].[ContactName], [t].[CustomerID], [o].[OrderID]"); - } } public override void Include_collection_with_multiple_conditional_order_by(bool useString) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs index aea30e6b1a6..75783a7f824 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs @@ -937,7 +937,6 @@ ELSE CAST(0 AS bit) END, [c].[CustomerID]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip(bool async) { await base.Skip(async); @@ -951,7 +950,6 @@ ORDER BY [c].[CustomerID] OFFSET @__p_0 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_no_orderby(bool async) { await base.Skip_no_orderby(async); @@ -965,7 +963,6 @@ ORDER BY (SELECT 1) OFFSET @__p_0 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_orderby_const(bool async) { await base.Skip_orderby_const(async); @@ -979,7 +976,6 @@ ORDER BY (SELECT 1) OFFSET @__p_0 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_Take(bool async) { await base.Skip_Take(async); @@ -994,7 +990,6 @@ ORDER BY [c].[ContactName] OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Join_Customers_Orders_Skip_Take(bool async) { await base.Join_Customers_Orders_Skip_Take(async); @@ -1025,7 +1020,6 @@ ORDER BY [o].[OrderID] OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Join_Customers_Orders_Projection_With_String_Concat_Skip_Take(bool async) { await base.Join_Customers_Orders_Projection_With_String_Concat_Skip_Take(async); @@ -1041,7 +1035,6 @@ ORDER BY [o].[OrderID] OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Join_Customers_Orders_Orders_Skip_Take_Same_Properties(bool async) { await base.Join_Customers_Orders_Orders_Skip_Take_Same_Properties(async); @@ -1080,7 +1073,6 @@ public override async Task Ternary_should_not_evaluate_both_sides_with_parameter FROM [Orders] AS [o]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Take_Skip(bool async) { await base.Take_Skip(async); @@ -1099,7 +1091,6 @@ ORDER BY [t].[ContactName] OFFSET @__p_1 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Take_Skip_Distinct(bool async) { await base.Take_Skip_Distinct(async); @@ -1121,7 +1112,6 @@ OFFSET @__p_1 ROWS ) AS [t0]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Take_Skip_Distinct_Caching(bool async) { await base.Take_Skip_Distinct_Caching(async); @@ -1926,7 +1916,6 @@ CROSS JOIN [Orders] AS [o] ORDER BY [t].[CustomerID], [t].[OrderID]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Distinct_Skip(bool async) { await base.Distinct_Skip(async); @@ -1943,7 +1932,6 @@ ORDER BY [t].[CustomerID] OFFSET @__p_0 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Distinct_Skip_Take(bool async) { await base.Distinct_Skip_Take(async); @@ -1961,7 +1949,6 @@ ORDER BY [t].[ContactName] OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_Distinct(bool async) { await base.Skip_Distinct(async); @@ -1978,7 +1965,6 @@ OFFSET @__p_0 ROWS ) AS [t]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_Take_Distinct(bool async) { await base.Skip_Take_Distinct(async); @@ -1996,7 +1982,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ) AS [t]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_Take_Any(bool async) { await base.Skip_Take_Any(async); @@ -2015,7 +2000,6 @@ ELSE CAST(0 AS bit) END"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_Take_All(bool async) { await base.Skip_Take_All(async); @@ -2038,7 +2022,6 @@ ELSE CAST(0 AS bit) END"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Take_All(bool async) { await base.Take_All(async); @@ -2059,7 +2042,6 @@ ELSE CAST(0 AS bit) END"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Skip_Take_Any_with_predicate(bool async) { await base.Skip_Take_Any_with_predicate(async); @@ -2082,7 +2064,6 @@ ELSE CAST(0 AS bit) END"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Take_Any_with_predicate(bool async) { await base.Take_Any_with_predicate(async); @@ -2602,7 +2583,6 @@ FROM [Customers] AS [c] WHERE COALESCE([c].[CompanyName], [c].[ContactName]) = N'The Big Cheese'"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Take_skip_null_coalesce_operator(bool async) { await base.Take_skip_null_coalesce_operator(async); @@ -2637,7 +2617,6 @@ public override async Task Select_take_null_coalesce_operator(bool async) //ORDER BY [Region]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Select_take_skip_null_coalesce_operator(bool async) { await base.Select_take_skip_null_coalesce_operator(async); @@ -2656,7 +2635,6 @@ ORDER BY [t].[c] OFFSET @__p_1 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Select_take_skip_null_coalesce_operator2(bool async) { await base.Select_take_skip_null_coalesce_operator2(async); @@ -2675,7 +2653,6 @@ ORDER BY [t].[c] OFFSET @__p_1 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task Select_take_skip_null_coalesce_operator3(bool async) { await base.Select_take_skip_null_coalesce_operator3(async); @@ -3354,7 +3331,6 @@ WHERE [o].[OrderID] > 15000 ORDER BY [t0].[OrderID], [o0].[OrderDate]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_take(bool async) { await base.OrderBy_skip_take(async); @@ -3369,7 +3345,6 @@ FROM [Customers] AS [c] OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_skip_take(bool async) { await base.OrderBy_skip_skip_take(async); @@ -3390,7 +3365,6 @@ OFFSET @__p_0 ROWS OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_take_take(bool async) { await base.OrderBy_skip_take_take(async); @@ -3410,7 +3384,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ORDER BY [t].[ContactTitle], [t].[ContactName]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_take_take_take_take(bool async) { await base.OrderBy_skip_take_take_take_take(async); @@ -3439,7 +3412,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ORDER BY [t1].[ContactTitle], [t1].[ContactName]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_take_skip_take_skip(bool async) { await base.OrderBy_skip_take_skip_take_skip(async); @@ -3466,7 +3438,6 @@ OFFSET @__p_2 ROWS FETCH NEXT @__p_3 ROWS ONLY OFFSET @__p_0 ROWS"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_take_distinct(bool async) { await base.OrderBy_skip_take_distinct(async); @@ -3484,7 +3455,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ) AS [t]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_coalesce_take_distinct(bool async) { await base.OrderBy_coalesce_take_distinct(async); @@ -3500,7 +3470,6 @@ ORDER BY COALESCE([p].[UnitPrice], 0.0) ) AS [t]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_coalesce_skip_take_distinct(bool async) { await base.OrderBy_coalesce_skip_take_distinct(async); @@ -3518,7 +3487,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ) AS [t]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_coalesce_skip_take_distinct_take(bool async) { await base.OrderBy_coalesce_skip_take_distinct_take(async); @@ -3536,7 +3504,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY ) AS [t]"); } - [SqlServerCondition(SqlServerCondition.SupportsOffset)] public override async Task OrderBy_skip_take_distinct_orderby_take(bool async) { await base.OrderBy_skip_take_distinct_orderby_take(async); diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs index 512ba0b2d02..3f3a9d4d387 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs @@ -187,10 +187,8 @@ public override async Task Skip_Select_Navigation(bool async) { await base.Skip_Select_Navigation(async); - if (TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsOffset)) ?? true) - { - AssertSql( - @"@__p_0='20' + AssertSql( + @"@__p_0='20' SELECT [t1].[OrderID], [t1].[CustomerID], [t1].[EmployeeID], [t1].[OrderDate] FROM ( @@ -208,7 +206,6 @@ FROM [Orders] AS [o] WHERE [t0].[row] <= 1 ) AS [t1] ON [t].[CustomerID] = [t1].[CustomerID] ORDER BY [t].[CustomerID]"); - } } public override async Task Select_Where_Navigation_Included(bool async) diff --git a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerCondition.cs b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerCondition.cs index 48a8592c556..b588c2fa69c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerCondition.cs +++ b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerCondition.cs @@ -9,14 +9,13 @@ namespace Microsoft.EntityFrameworkCore.TestUtilities public enum SqlServerCondition { SupportsSequences = 1 << 0, - SupportsOffset = 1 << 1, - IsSqlAzure = 1 << 2, - IsNotSqlAzure = 1 << 3, - SupportsMemoryOptimized = 1 << 4, - SupportsAttach = 1 << 5, - SupportsHiddenColumns = 1 << 6, - IsNotCI = 1 << 7, - SupportsFullTextSearch = 1 << 8, - SupportsOnlineIndexes = 1 << 9 + IsSqlAzure = 1 << 1, + IsNotSqlAzure = 1 << 2, + SupportsMemoryOptimized = 1 << 3, + SupportsAttach = 1 << 4, + SupportsHiddenColumns = 1 << 5, + IsNotCI = 1 << 6, + SupportsFullTextSearch = 1 << 7, + SupportsOnlineIndexes = 1 << 8 } } diff --git a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerConditionAttribute.cs b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerConditionAttribute.cs index 90e92169e08..4690375c1c3 100644 --- a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerConditionAttribute.cs +++ b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerConditionAttribute.cs @@ -27,11 +27,6 @@ public ValueTask IsMetAsync() isMet &= TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsSequences)) ?? true; } - if (Conditions.HasFlag(SqlServerCondition.SupportsOffset)) - { - isMet &= TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsOffset)) ?? true; - } - if (Conditions.HasFlag(SqlServerCondition.SupportsHiddenColumns)) { isMet &= TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsHiddenColumns)) ?? false; @@ -66,7 +61,7 @@ public ValueTask IsMetAsync() if (Conditions.HasFlag(SqlServerCondition.SupportsFullTextSearch)) { - isMet &= TestEnvironment.IsFullTestSearchSupported; + isMet &= TestEnvironment.IsFullTextSearchSupported; } return new ValueTask(isMet); diff --git a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestEnvironment.cs b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestEnvironment.cs index a6d7fc82d09..a49b88b5776 100644 --- a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestEnvironment.cs +++ b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestEnvironment.cs @@ -29,12 +29,11 @@ public static class TestEnvironment public static bool IsSqlAzure { get; } = _dataSource.Contains("database.windows.net"); - public static bool IsCI { get; } = Environment.GetEnvironmentVariable("PIPELINE_WORKSPACE") != null - || Environment.GetEnvironmentVariable("TEAMCITY_VERSION") != null; + public static bool IsCI { get; } = Environment.GetEnvironmentVariable("PIPELINE_WORKSPACE") != null; private static bool? _fullTextInstalled; - public static bool IsFullTestSearchSupported + public static bool IsFullTextSearchSupported { get { @@ -59,16 +58,6 @@ public static bool IsFullTestSearchSupported var result = (int)command.ExecuteScalar(); _fullTextInstalled = result == 1; - - if (_fullTextInstalled.Value) - { - var flag = GetFlag("SupportsFullTextSearch"); - - if (flag.HasValue) - { - return flag.Value; - } - } } } catch (PlatformNotSupportedException) diff --git a/test/EFCore.SqlServer.FunctionalTests/config.json b/test/EFCore.SqlServer.FunctionalTests/config.json index 9b2e2823fd2..e25ce2277f0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/config.json +++ b/test/EFCore.SqlServer.FunctionalTests/config.json @@ -4,10 +4,8 @@ "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Database=master;Integrated Security=True;Connect Timeout=60;ConnectRetryCount=0", "ElasticPoolName": "", "SupportsSequences": true, - "SupportsOffset": true, "SupportsMemoryOptimized": false, "SupportsHiddenColumns": true, - "SupportsFullTextSearch": true, "SupportsOnlineIndexes": false } }