From 362ff11bc0c77314088d9ad680c1afa637818a05 Mon Sep 17 00:00:00 2001 From: Jiri Cincura Date: Sat, 7 Dec 2019 17:23:58 +0100 Subject: [PATCH] Ordering fix (#19220) --- .../Query/NorthwindMiscellaneousQueryTestBase.cs | 2 +- .../Query/NorthwindMiscellaneousQuerySqlServerTest.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs index 45a544a2ac0..0607aa847c5 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs @@ -1306,7 +1306,7 @@ from e in ss.Set().OrderBy(ee => ee.EmployeeID).Take(3).Select( from o in ss.Set().OrderBy(oo => oo.OrderID).Take(5).Select( o => new { o }) select new { e, o }) - from c in ss.Set().Take(2).Select( + from c in ss.Set().OrderBy(cc => cc.CustomerID).Take(2).Select( c => new { c }) select new { diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs index 6d84f6276b4..1c5b84916be 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs @@ -830,7 +830,6 @@ public override async Task Where_subquery_anon_nested(bool async) AssertSql( @"@__p_0='3' -@__p_1='2' SELECT [t].[EmployeeID], [t].[City], [t].[Country], [t].[FirstName], [t].[ReportsTo], [t].[Title], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate], [t1].[CustomerID], [t1].[Address], [t1].[City], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Country], [t1].[Fax], [t1].[Phone], [t1].[PostalCode], [t1].[Region] FROM ( @@ -844,8 +843,9 @@ FROM [Orders] AS [o] ORDER BY [o].[OrderID] ) AS [t0] CROSS JOIN ( - SELECT TOP(@__p_1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] + SELECT TOP(2) [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] + ORDER BY [c].[CustomerID] ) AS [t1] WHERE [t].[City] = N'Seattle' ORDER BY [t].[EmployeeID]");