Skip to content

Commit e0e91fd

Browse files
committed
Update baselines
1 parent 9dbbdc8 commit e0e91fd

8 files changed

+70
-112
lines changed

test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyNoTrackingQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
300300
"""
301301
SELECT [s0].[Id], [s0].[Name]
302302
FROM [EntityOnes] AS [e]
303-
OUTER APPLY (
304-
SELECT TOP(1) [s].[Id], [s].[Name]
303+
LEFT JOIN (
304+
SELECT [s].[Id], [s].[Name], [s].[LeftId]
305305
FROM (
306-
SELECT TOP(1) [e0].[Id], [e0].[Name]
306+
SELECT [e0].[Id], [e0].[Name], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
307307
FROM [JoinOneSelfPayload] AS [j]
308308
INNER JOIN [EntityOnes] AS [e0] ON [j].[RightId] = [e0].[Id]
309-
WHERE [e].[Id] = [j].[LeftId]
310-
ORDER BY [e0].[Id]
311309
) AS [s]
312-
ORDER BY [s].[Id]
313-
) AS [s0]
310+
WHERE [s].[row] <= 1
311+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
314312
""");
315313
}
316314

test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
299299
"""
300300
SELECT [s0].[Id], [s0].[Name]
301301
FROM [EntityOnes] AS [e]
302-
OUTER APPLY (
303-
SELECT TOP(1) [s].[Id], [s].[Name]
302+
LEFT JOIN (
303+
SELECT [s].[Id], [s].[Name], [s].[LeftId]
304304
FROM (
305-
SELECT TOP(1) [e0].[Id], [e0].[Name]
305+
SELECT [e0].[Id], [e0].[Name], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
306306
FROM [JoinOneSelfPayload] AS [j]
307307
INNER JOIN [EntityOnes] AS [e0] ON [j].[RightId] = [e0].[Id]
308-
WHERE [e].[Id] = [j].[LeftId]
309-
ORDER BY [e0].[Id]
310308
) AS [s]
311-
ORDER BY [s].[Id]
312-
) AS [s0]
309+
WHERE [s].[row] <= 1
310+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
313311
""");
314312
}
315313

test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSelectQuerySqlServerTest.cs

+35-63
Original file line numberDiff line numberDiff line change
@@ -760,14 +760,10 @@ public override async Task Project_single_element_from_collection_with_OrderBy_T
760760
AssertSql(
761761
"""
762762
SELECT (
763-
SELECT TOP(1) [o0].[CustomerID]
764-
FROM (
765-
SELECT TOP(1) [o].[CustomerID], [o].[OrderID]
766-
FROM [Orders] AS [o]
767-
WHERE [c].[CustomerID] = [o].[CustomerID]
768-
ORDER BY [o].[OrderID]
769-
) AS [o0]
770-
ORDER BY [o0].[OrderID])
763+
SELECT TOP(1) [o].[CustomerID]
764+
FROM [Orders] AS [o]
765+
WHERE [c].[CustomerID] = [o].[CustomerID]
766+
ORDER BY [o].[OrderID])
771767
FROM [Customers] AS [c]
772768
""");
773769
}
@@ -828,14 +824,10 @@ public override async Task Project_single_element_from_collection_with_OrderBy_T
828824
AssertSql(
829825
"""
830826
SELECT (
831-
SELECT TOP(1) [o0].[CustomerID]
832-
FROM (
833-
SELECT TOP(1) [o].[CustomerID], [o].[OrderID]
834-
FROM [Orders] AS [o]
835-
WHERE [c].[CustomerID] = [o].[CustomerID]
836-
ORDER BY [o].[OrderID]
837-
) AS [o0]
838-
ORDER BY [o0].[OrderID])
827+
SELECT TOP(1) [o].[CustomerID]
828+
FROM [Orders] AS [o]
829+
WHERE [c].[CustomerID] = [o].[CustomerID]
830+
ORDER BY [o].[OrderID])
839831
FROM [Customers] AS [c]
840832
WHERE [c].[CustomerID] = N'ALFKI'
841833
""");
@@ -869,14 +861,10 @@ public override async Task Project_single_element_from_collection_with_multiple_
869861
AssertSql(
870862
"""
871863
SELECT (
872-
SELECT TOP(1) [o0].[CustomerID]
873-
FROM (
874-
SELECT TOP(2) [o].[CustomerID], [o].[OrderID], [o].[OrderDate]
875-
FROM [Orders] AS [o]
876-
WHERE [c].[CustomerID] = [o].[CustomerID]
877-
ORDER BY [o].[OrderID], [o].[OrderDate] DESC
878-
) AS [o0]
879-
ORDER BY [o0].[OrderID], [o0].[OrderDate] DESC)
864+
SELECT TOP(1) [o].[CustomerID]
865+
FROM [Orders] AS [o]
866+
WHERE [c].[CustomerID] = [o].[CustomerID]
867+
ORDER BY [o].[OrderID], [o].[OrderDate] DESC)
880868
FROM [Customers] AS [c]
881869
""");
882870
}
@@ -892,14 +880,10 @@ await base
892880
AssertSql(
893881
"""
894882
SELECT (
895-
SELECT TOP(1) [o0].[c]
896-
FROM (
897-
SELECT TOP(2) CAST(LEN([o].[CustomerID]) AS int) AS [c], [o].[OrderID], [o].[OrderDate]
898-
FROM [Orders] AS [o]
899-
WHERE [c].[CustomerID] = [o].[CustomerID]
900-
ORDER BY [o].[OrderID], [o].[OrderDate] DESC
901-
) AS [o0]
902-
ORDER BY [o0].[OrderID], [o0].[OrderDate] DESC)
883+
SELECT TOP(1) CAST(LEN([o].[CustomerID]) AS int)
884+
FROM [Orders] AS [o]
885+
WHERE [c].[CustomerID] = [o].[CustomerID]
886+
ORDER BY [o].[OrderID], [o].[OrderDate] DESC)
903887
FROM [Customers] AS [c]
904888
""");
905889
}
@@ -911,14 +895,10 @@ public override async Task Project_single_element_from_collection_with_multiple_
911895
AssertSql(
912896
"""
913897
SELECT (
914-
SELECT TOP(1) [o0].[CustomerID]
915-
FROM (
916-
SELECT TOP(2) [o].[CustomerID], [o].[OrderDate]
917-
FROM [Orders] AS [o]
918-
WHERE [c].[CustomerID] = [o].[CustomerID]
919-
ORDER BY [o].[CustomerID], [o].[OrderDate] DESC
920-
) AS [o0]
921-
ORDER BY [o0].[CustomerID], [o0].[OrderDate] DESC)
898+
SELECT TOP(1) [o].[CustomerID]
899+
FROM [Orders] AS [o]
900+
WHERE [c].[CustomerID] = [o].[CustomerID]
901+
ORDER BY [o].[CustomerID], [o].[OrderDate] DESC)
922902
FROM [Customers] AS [c]
923903
""");
924904
}
@@ -930,15 +910,11 @@ public override async Task Project_single_element_from_collection_with_OrderBy_o
930910
AssertSql(
931911
"""
932912
SELECT COALESCE((
933-
SELECT TOP(1) [s].[OrderID]
934-
FROM (
935-
SELECT TOP(1) [o0].[OrderID], [p].[ProductName]
936-
FROM [Order Details] AS [o0]
937-
INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID]
938-
WHERE [o].[OrderID] = [o0].[OrderID]
939-
ORDER BY [p].[ProductName]
940-
) AS [s]
941-
ORDER BY [s].[ProductName]), 0)
913+
SELECT TOP(1) [o0].[OrderID]
914+
FROM [Order Details] AS [o0]
915+
INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID]
916+
WHERE [o].[OrderID] = [o0].[OrderID]
917+
ORDER BY [p].[ProductName]), 0)
942918
FROM [Orders] AS [o]
943919
WHERE [o].[OrderID] < 10300
944920
""");
@@ -953,17 +929,15 @@ public override async Task Project_single_element_from_collection_with_OrderBy_o
953929
"""
954930
SELECT [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[Quantity], [s0].[UnitPrice]
955931
FROM [Orders] AS [o]
956-
OUTER APPLY (
957-
SELECT TOP(1) [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[Quantity], [s].[UnitPrice]
932+
LEFT JOIN (
933+
SELECT [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[Quantity], [s].[UnitPrice]
958934
FROM (
959-
SELECT TOP(1) [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [p].[ProductName]
935+
SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], ROW_NUMBER() OVER(PARTITION BY [o0].[OrderID] ORDER BY [p].[ProductName]) AS [row]
960936
FROM [Order Details] AS [o0]
961937
INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID]
962-
WHERE [o].[OrderID] = [o0].[OrderID]
963-
ORDER BY [p].[ProductName]
964938
) AS [s]
965-
ORDER BY [s].[ProductName]
966-
) AS [s0]
939+
WHERE [s].[row] <= 1
940+
) AS [s0] ON [o].[OrderID] = [s0].[OrderID]
967941
WHERE [o].[OrderID] < 10250
968942
""");
969943
}
@@ -1344,16 +1318,14 @@ public override async Task SelectMany_with_multiple_Take(bool async)
13441318
"""
13451319
SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate]
13461320
FROM [Customers] AS [c]
1347-
CROSS APPLY (
1348-
SELECT TOP(3) [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate]
1321+
INNER JOIN (
1322+
SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate]
13491323
FROM (
1350-
SELECT TOP(5) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
1324+
SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o].[CustomerID] ORDER BY [o].[OrderID]) AS [row]
13511325
FROM [Orders] AS [o]
1352-
WHERE [c].[CustomerID] = [o].[CustomerID]
1353-
ORDER BY [o].[OrderID]
13541326
) AS [o0]
1355-
ORDER BY [o0].[OrderID]
1356-
) AS [o1]
1327+
WHERE [o0].[row] <= 3
1328+
) AS [o1] ON [c].[CustomerID] = [o1].[CustomerID]
13571329
""");
13581330
}
13591331

test/EFCore.SqlServer.FunctionalTests/Query/TPCManyToManyNoTrackingQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
328328
"""
329329
SELECT [s0].[Id], [s0].[Name]
330330
FROM [EntityOnes] AS [e]
331-
OUTER APPLY (
332-
SELECT TOP(1) [s].[Id], [s].[Name]
331+
LEFT JOIN (
332+
SELECT [s].[Id], [s].[Name], [s].[LeftId]
333333
FROM (
334-
SELECT TOP(1) [e0].[Id], [e0].[Name]
334+
SELECT [e0].[Id], [e0].[Name], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
335335
FROM [JoinOneSelfPayload] AS [j]
336336
INNER JOIN [EntityOnes] AS [e0] ON [j].[RightId] = [e0].[Id]
337-
WHERE [e].[Id] = [j].[LeftId]
338-
ORDER BY [e0].[Id]
339337
) AS [s]
340-
ORDER BY [s].[Id]
341-
) AS [s0]
338+
WHERE [s].[row] <= 1
339+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
342340
""");
343341
}
344342

test/EFCore.SqlServer.FunctionalTests/Query/TPCManyToManyQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
328328
"""
329329
SELECT [s0].[Id], [s0].[Name]
330330
FROM [EntityOnes] AS [e]
331-
OUTER APPLY (
332-
SELECT TOP(1) [s].[Id], [s].[Name]
331+
LEFT JOIN (
332+
SELECT [s].[Id], [s].[Name], [s].[LeftId]
333333
FROM (
334-
SELECT TOP(1) [e0].[Id], [e0].[Name]
334+
SELECT [e0].[Id], [e0].[Name], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
335335
FROM [JoinOneSelfPayload] AS [j]
336336
INNER JOIN [EntityOnes] AS [e0] ON [j].[RightId] = [e0].[Id]
337-
WHERE [e].[Id] = [j].[LeftId]
338-
ORDER BY [e0].[Id]
339337
) AS [s]
340-
ORDER BY [s].[Id]
341-
) AS [s0]
338+
WHERE [s].[row] <= 1
339+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
342340
""");
343341
}
344342

test/EFCore.SqlServer.FunctionalTests/Query/TPTManyToManyNoTrackingQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
308308
"""
309309
SELECT [s0].[Id], [s0].[Name]
310310
FROM [EntityOnes] AS [e]
311-
OUTER APPLY (
312-
SELECT TOP(1) [s].[Id], [s].[Name]
311+
LEFT JOIN (
312+
SELECT [s].[Id], [s].[Name], [s].[LeftId]
313313
FROM (
314-
SELECT TOP(1) [e0].[Id], [e0].[Name]
314+
SELECT [e0].[Id], [e0].[Name], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
315315
FROM [JoinOneSelfPayload] AS [j]
316316
INNER JOIN [EntityOnes] AS [e0] ON [j].[RightId] = [e0].[Id]
317-
WHERE [e].[Id] = [j].[LeftId]
318-
ORDER BY [e0].[Id]
319317
) AS [s]
320-
ORDER BY [s].[Id]
321-
) AS [s0]
318+
WHERE [s].[row] <= 1
319+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
322320
""");
323321
}
324322

test/EFCore.SqlServer.FunctionalTests/Query/TPTManyToManyQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
307307
"""
308308
SELECT [s0].[Id], [s0].[Name]
309309
FROM [EntityOnes] AS [e]
310-
OUTER APPLY (
311-
SELECT TOP(1) [s].[Id], [s].[Name]
310+
LEFT JOIN (
311+
SELECT [s].[Id], [s].[Name], [s].[LeftId]
312312
FROM (
313-
SELECT TOP(1) [e0].[Id], [e0].[Name]
313+
SELECT [e0].[Id], [e0].[Name], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
314314
FROM [JoinOneSelfPayload] AS [j]
315315
INNER JOIN [EntityOnes] AS [e0] ON [j].[RightId] = [e0].[Id]
316-
WHERE [e].[Id] = [j].[LeftId]
317-
ORDER BY [e0].[Id]
318316
) AS [s]
319-
ORDER BY [s].[Id]
320-
) AS [s0]
317+
WHERE [s].[row] <= 1
318+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
321319
""");
322320
}
323321

test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,15 @@ public override async Task Skip_navigation_order_by_single_or_default(bool async
333333
"""
334334
SELECT [s0].[Id], [s0].[Name], [s0].[PeriodEnd], [s0].[PeriodStart]
335335
FROM [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e]
336-
OUTER APPLY (
337-
SELECT TOP(1) [s].[Id], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart]
336+
LEFT JOIN (
337+
SELECT [s].[Id], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart], [s].[LeftId]
338338
FROM (
339-
SELECT TOP(1) [e0].[Id], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart]
339+
SELECT [e0].[Id], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart], [j].[LeftId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row]
340340
FROM [JoinOneSelfPayload] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j]
341341
INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[RightId] = [e0].[Id]
342-
WHERE [e].[Id] = [j].[LeftId]
343-
ORDER BY [e0].[Id]
344342
) AS [s]
345-
ORDER BY [s].[Id]
346-
) AS [s0]
343+
WHERE [s].[row] <= 1
344+
) AS [s0] ON [e].[Id] = [s0].[LeftId]
347345
""");
348346
}
349347

0 commit comments

Comments
 (0)